Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a feature flag in Kubernetes?
A feature flag is a way to turn features on or off in your application without changing the code. In Kubernetes, it helps control new features safely by toggling them using configuration.
Click to reveal answer
beginner
How can ConfigMaps be used for feature flags in Kubernetes?
ConfigMaps store configuration data as key-value pairs. You can use them to hold feature flag values and mount them into pods so your app reads the flags and enables or disables features accordingly.
Click to reveal answer
beginner
What is the benefit of using feature flags in Kubernetes deployments?
Feature flags let you release new features gradually, test them in production, and quickly disable them if problems occur, all without redeploying your app.
Click to reveal answer
intermediate
Which Kubernetes resource is commonly used to manage feature flags dynamically?
ConfigMaps are commonly used because they can be updated without restarting pods, allowing feature flags to change dynamically.
Click to reveal answer
intermediate
How does a pod access feature flags stored in a ConfigMap?
A pod can mount the ConfigMap as a volume or use environment variables from the ConfigMap. The application inside the pod reads these values to decide which features to enable.
Click to reveal answer
What Kubernetes object is best suited to store feature flag settings?
AService
BPod
CDeployment
DConfigMap
✗ Incorrect
ConfigMaps store configuration data like feature flags, separate from application code.
How can feature flags be updated without redeploying an application in Kubernetes?
ABy restarting the pod manually
BBy updating the ConfigMap and letting pods reload it
CBy changing the container image
DBy deleting the deployment
✗ Incorrect
Updating the ConfigMap allows pods to get new flag values without redeploying the app.
What is a key advantage of using feature flags in production?
AEnable or disable features instantly without code changes
BIncrease pod memory automatically
CScale the number of pods
DChange container images
✗ Incorrect
Feature flags let you toggle features on or off instantly without changing code.
Which method can a pod use to access feature flags from a ConfigMap?
AAccess Deployment specs
BUse a Service to fetch flags
CMount ConfigMap as a volume or use environment variables
DRead from a Secret
✗ Incorrect
Pods can mount ConfigMaps as files or environment variables to read feature flags.
Why is it useful to use feature flags during gradual rollouts?
ATo control which users see new features safely
BTo increase CPU limits
CTo change pod labels
DTo update container images
✗ Incorrect
Feature flags help release features to some users first, reducing risk.
Explain how feature flags work in Kubernetes and why they are useful.
Think about how you can turn features on or off without changing code.
You got /3 concepts.
Describe the steps to implement a feature flag using a ConfigMap in Kubernetes.
Focus on ConfigMap creation, pod access, and dynamic updates.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of feature flags in Kubernetes?
easy
A. To manage Kubernetes cluster nodes
B. To monitor cluster health
C. To schedule pods across nodes
D. To enable or disable application features without changing code
Solution
Step 1: Understand feature flags concept
Feature flags allow toggling features on or off without modifying the application code.
Step 2: Relate to Kubernetes usage
In Kubernetes, feature flags help control app behavior dynamically, often via ConfigMaps or environment variables.
Final Answer:
To enable or disable application features without changing code -> Option D
Quick Check:
Feature flags = toggle features without code change [OK]
Hint: Feature flags toggle features without code edits [OK]
Common Mistakes:
Confusing feature flags with cluster management
Thinking feature flags manage pods or nodes
Mixing feature flags with monitoring tools
2. Which Kubernetes resource is commonly used to store feature flags for an application?
easy
A. Service
B. Pod
C. ConfigMap
D. Ingress
Solution
Step 1: Identify resource types
Pods run containers, Services expose them, Ingress manages external access, ConfigMaps store configuration data.
Step 2: Match feature flags storage
Feature flags are configuration data, so ConfigMaps are the right resource to store them.
Final Answer:
ConfigMap -> Option C
Quick Check:
Feature flags stored in ConfigMap [OK]
Hint: ConfigMaps hold config data like feature flags [OK]
Common Mistakes:
Choosing Pod instead of ConfigMap
Confusing Service or Ingress with config storage
Thinking feature flags are stored in Secrets
3. Given this ConfigMap YAML snippet for feature flags:
If the ConfigMap 'feature-flags' does not have the key FEATURE_Z_ENABLED, what will happen when the pod starts?
medium
A. Pod will fail to start with an error
B. Pod will start with FEATURE_Z_ENABLED set to an empty string
C. Pod will start with FEATURE_Z_ENABLED set to null
D. Pod will ignore the environment variable
Solution
Step 1: Understand configMapKeyRef behavior
If the specified key is missing in the ConfigMap, Kubernetes treats it as an error.
Step 2: Effect on pod startup
The pod will fail to start because the environment variable cannot be resolved from the ConfigMap key.
Final Answer:
Pod will fail to start with an error -> Option A
Quick Check:
Missing ConfigMap key causes pod start failure [OK]
Hint: Missing ConfigMap key breaks pod start [OK]
Common Mistakes:
Assuming empty string or null is set silently
Thinking pod ignores missing keys
Confusing with optional environment variables
5. You want to enable a new feature only for 10% of users using feature flags in Kubernetes. Which approach best supports this scenario?
hard
A. Use a ConfigMap with a boolean flag set to true or false
B. Store a percentage value in ConfigMap and let the app decide feature enablement per user
C. Use a Secret to store the feature flag and update it daily
D. Deploy two versions of the app and route 10% traffic to the new version
Solution
Step 1: Understand percentage-based feature flags
To enable a feature for a subset of users, the flag must support partial enablement, not just true/false.
Step 2: Evaluate options
Store a percentage value in ConfigMap and let the app decide feature enablement per user stores a percentage in ConfigMap; the app reads it and enables the feature for that percent of users dynamically.
Final Answer:
Store a percentage value in ConfigMap and let the app decide feature enablement per user -> Option B
Quick Check:
Percentage flags need app logic with ConfigMap value [OK]
Hint: Use percentage value in ConfigMap for partial rollout [OK]