Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create an immutable ConfigMap.
Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
name: example-config
immutable: [1]
data:
key: value Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values like "true" instead of boolean true.
Setting immutable to false which does not make ConfigMap immutable.
✗ Incorrect
Setting immutable: true makes the ConfigMap immutable, preventing changes after creation.
2fill in blank
mediumComplete the command to create an immutable ConfigMap from a file.
Kubernetes
kubectl create configmap example-config --from-file=config.txt --[1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to assign a value to the immutable flag.
Using incorrect flag syntax.
✗ Incorrect
The --immutable flag is used without an equals sign to create an immutable ConfigMap.
3fill in blank
hardFix the error in the ConfigMap YAML to make it immutable.
Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
name: example-config
immutable: [1]
data:
key: value Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quoted strings instead of boolean values.
Capitalizing boolean values.
✗ Incorrect
The immutable field requires a lowercase boolean true without quotes.
4fill in blank
hardFill both blanks to complete the command that updates a ConfigMap to be immutable.
Kubernetes
kubectl patch configmap example-config -p '{"immutable": [1], "data": [2]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using false for immutable when making ConfigMap immutable.
Incorrect JSON format for data.
✗ Incorrect
Set immutable to true and update data with the new key-value pair.
5fill in blank
hardFill all three blanks to create an immutable ConfigMap with a label and data.
Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
name: example-config
labels:
app: [1]
immutable: [2]
data:
config.yaml: [3] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using false for immutable.
Not quoting the data string.
✗ Incorrect
Label the ConfigMap with myapp, set immutable to true, and provide the data as a string.