0
0
Kubernetesdevops~20 mins

Feature flags in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Feature Flags Mastery in Kubernetes
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary purpose of feature flags in Kubernetes?

Feature flags are used in Kubernetes to:

AIncrease the CPU and memory limits of pods dynamically
BAutomatically scale pods based on network traffic
CControl the rollout of new features without redeploying the entire application
DEncrypt data stored in Kubernetes secrets
Attempts:
2 left
💡 Hint

Think about how you can enable or disable features without changing the app code or redeploying.

💻 Command Output
intermediate
1:30remaining
What is the output of this kubectl command?

Given a ConfigMap named feature-flags with a key newUI set to true, what does this command output?

kubectl get configmap feature-flags -o jsonpath='{.data.newUI}'
Afalse
BError: configmap not found
Cnull
Dtrue
Attempts:
2 left
💡 Hint

Check the key value inside the ConfigMap data field.

Configuration
advanced
2:00remaining
Which YAML snippet correctly defines a ConfigMap for feature flags with 'betaFeature' enabled?

Select the valid Kubernetes ConfigMap YAML that sets a feature flag betaFeature to enabled.

A
apiVersion: v1
kind: ConfigMap
metadata:
  name: feature-flags
data:
  - betaFeature: enabled
B
apiVersion: v1
kind: ConfigMap
metadata:
  name: feature-flags
data:
  betaFeature: enabled
C
apiVersion: v1
kind: ConfigMap
metadata:
  name: feature-flags
features:
  betaFeature: enabled
D
apiVersion: v1
kind: ConfigMap
metadata:
  name: feature-flags
spec:
  betaFeature: enabled
Attempts:
2 left
💡 Hint

ConfigMap data must be under the data field as key-value pairs.

🔀 Workflow
advanced
2:30remaining
What is the correct sequence to update a feature flag in a running Kubernetes cluster?

Put these steps in the correct order to update a feature flag stored in a ConfigMap:

A1,4,2,3
B4,1,3,2
C1,2,4,3
D2,1,4,3
Attempts:
2 left
💡 Hint

Think about editing first, then saving, verifying, and finally ensuring pods use the new config.

Troubleshoot
expert
2:00remaining
Why might a pod not reflect a changed feature flag in a ConfigMap immediately?

You updated a feature flag in a ConfigMap, but the pod still behaves as if the old flag is active. What is the most likely reason?

AThe pod has not been restarted or does not watch for ConfigMap changes
BThe ConfigMap was deleted accidentally
CThe feature flag key was misspelled in the ConfigMap
DThe pod's CPU limit is too low to apply changes
Attempts:
2 left
💡 Hint

Consider how pods get updated ConfigMap data during runtime.