Complete the code to create a ConfigMap named 'feature-flags' with a key 'enableFeatureX' set to 'true'.
apiVersion: v1 kind: ConfigMap metadata: name: feature-flags data: enableFeatureX: "[1]"
The value for the feature flag should be the string "true" to enable the feature.
Complete the command to apply the ConfigMap file named 'feature-flags.yaml' to the Kubernetes cluster.
kubectl [1] -f feature-flags.yamlThe kubectl apply command updates or creates resources from a file.
Fix the error in the Deployment YAML snippet to use the feature flag from the ConfigMap as an environment variable named FEATURE_X_ENABLED.
env:
- name: FEATURE_X_ENABLED
valueFrom:
configMapKeyRef:
name: feature-flags
[1]: enableFeatureXThe correct field to reference a key in a ConfigMap is key.
Fill both blanks to create a Deployment environment variable that uses the feature flag 'enableFeatureY' from the ConfigMap named 'feature-flags'.
env:
- name: FEATURE_Y_ENABLED
valueFrom:
configMapKeyRef:
name: [1]
[2]: enableFeatureYThe ConfigMap name is 'feature-flags' and the key field is 'key'.
Fill all three blanks to create a ConfigMap with two feature flags: 'enableFeatureA' set to 'true' and 'enableFeatureB' set to 'false'.
apiVersion: v1 kind: ConfigMap metadata: name: [1] data: enableFeatureA: "[2]" enableFeatureB: "[3]"
The ConfigMap name is 'feature-flags'. Feature A is enabled with 'true' and Feature B is disabled with 'false'.