0
0
Kubernetesdevops~10 mins

Feature flags in Kubernetes - Interactive Code Practice

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

Complete the code to create a ConfigMap named 'feature-flags' with a key 'enableFeatureX' set to 'true'.

Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
  name: feature-flags
data:
  enableFeatureX: "[1]"
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
Cenabled
Dyes
Attempts:
3 left
💡 Hint
Common Mistakes
Using boolean true without quotes causes YAML parsing errors.
Using 'enabled' or 'yes' instead of 'true' as string.
2fill in blank
medium

Complete the command to apply the ConfigMap file named 'feature-flags.yaml' to the Kubernetes cluster.

Kubernetes
kubectl [1] -f feature-flags.yaml
Drag options to blanks, or click blank then click option'
Adelete
Bget
Ccreate
Dapply
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' will fail if the resource already exists.
Using 'delete' removes resources instead of creating or updating.
3fill in blank
hard

Fix the error in the Deployment YAML snippet to use the feature flag from the ConfigMap as an environment variable named FEATURE_X_ENABLED.

Kubernetes
env:
  - name: FEATURE_X_ENABLED
    valueFrom:
      configMapKeyRef:
        name: feature-flags
        [1]: enableFeatureX
Drag options to blanks, or click blank then click option'
AkeyRef
Bkey
CkeyName
DkeyFrom
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'keyName' or 'keyRef' causes Kubernetes to reject the manifest.
Using 'keyFrom' is not a valid field.
4fill in blank
hard

Fill both blanks to create a Deployment environment variable that uses the feature flag 'enableFeatureY' from the ConfigMap named 'feature-flags'.

Kubernetes
env:
  - name: FEATURE_Y_ENABLED
    valueFrom:
      configMapKeyRef:
        name: [1]
        [2]: enableFeatureY
Drag options to blanks, or click blank then click option'
Afeature-flags
Bfeature-flags-prod
Ckey
DkeyRef
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong ConfigMap name.
Using 'keyRef' instead of 'key' for the key field.
5fill in blank
hard

Fill all three blanks to create a ConfigMap with two feature flags: 'enableFeatureA' set to 'true' and 'enableFeatureB' set to 'false'.

Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
  name: [1]
data:
  enableFeatureA: "[2]"
  enableFeatureB: "[3]"
Drag options to blanks, or click blank then click option'
Afeature-flags
Btrue
Cfalse
Dfeature-flags-prod
Attempts:
3 left
💡 Hint
Common Mistakes
Using boolean true/false without quotes.
Mixing up the feature flag values.