0
0
Kubernetesdevops~10 mins

Updating ConfigMaps and propagation in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to update a ConfigMap named 'app-config' from a file 'config.yaml'.

Kubernetes
kubectl create configmap app-config --from-file=[1] --dry-run=client -o yaml | kubectl apply -f -
Drag options to blanks, or click blank then click option'
Aconfig.json
Bapp.yaml
Cconfig.yaml
Dsettings.conf
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong file name or extension.
Forgetting to use --dry-run=client before applying.
2fill in blank
medium

Complete the command to patch a ConfigMap named 'app-config' with a new key 'log_level' set to 'debug'.

Kubernetes
kubectl patch configmap app-config -p '{"data": {"[1]": "debug"}}'
Drag options to blanks, or click blank then click option'
Alog_level
Blog-level
Cloglevel
DlogLevel
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase or hyphen instead of underscore.
Misspelling the key name.
3fill in blank
hard

Fix the error in the command to reload pods after ConfigMap update by adding the correct annotation key.

Kubernetes
kubectl patch deployment my-app -p '{"spec": {"template": {"metadata": {"annotations": {"[1]": "$(date +%s)"}}}}}'
Drag options to blanks, or click blank then click option'
Akubectl.kubernetes.io/restartedAt
Bkubectl.kubernetes.io/restartAt
Ckubectl.kubernetes.io/restart-time
Dkubectl.kubernetes.io/restart
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling the annotation key.
Using incomplete or incorrect annotation keys.
4fill in blank
hard

Fill both blanks to create a ConfigMap from literal key-value pairs and apply it.

Kubernetes
kubectl create configmap my-config [1]=value1 [2]=value2 --dry-run=client -o yaml | kubectl apply -f -
Drag options to blanks, or click blank then click option'
A--from-literal=key1
B--from-literal=key2
C--from-file=key1
D--from-file=key2
Attempts:
3 left
💡 Hint
Common Mistakes
Using --from-file instead of --from-literal.
Combining multiple keys in one option.
5fill in blank
hard

Fill all three blanks to update a ConfigMap, patch a deployment to restart pods, and verify pods status.

Kubernetes
kubectl create configmap app-config --from-file=[1] --dry-run=client -o yaml | kubectl apply -f - && kubectl patch deployment my-app -p '{"spec": {"template": {"metadata": {"annotations": {"[2]": "$(date +%s)"}}}}}' && kubectl get pods -l app=my-app -o [3]
Drag options to blanks, or click blank then click option'
Aconfig.yaml
Bkubectl.kubernetes.io/restartedAt
Cwide
Djson
Attempts:
3 left
💡 Hint
Common Mistakes
Wrong file name.
Incorrect annotation key.
Using 'json' instead of 'wide' for pod output.