0
0
Microservicessystem_design~20 mins

ConfigMaps and Secrets in Microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ConfigMaps and Secrets Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding the primary purpose of ConfigMaps
What is the main purpose of using ConfigMaps in a microservices architecture?
ATo manage network policies between microservices
BTo store sensitive data like passwords and API keys securely
CTo provide configuration data to containers in a decoupled way
DTo monitor the health status of microservices
Attempts:
2 left
💡 Hint
Think about how configuration data is separated from application code.
Architecture
intermediate
2:00remaining
Choosing between ConfigMaps and Secrets
You need to store database credentials for your microservices. Which Kubernetes resource should you use and why?
ASecrets, because they provide base64 encoding and better access control for sensitive data
BConfigMaps, because they are designed for storing all types of configuration data
CConfigMaps, because they automatically encrypt data at rest
DSecrets, because they are only accessible by the Kubernetes master node
Attempts:
2 left
💡 Hint
Consider security and access control for sensitive information.
scaling
advanced
2:30remaining
Scaling microservices with ConfigMaps and Secrets updates
When you update a ConfigMap or Secret used by multiple microservice pods, what is the best practice to ensure all pods receive the updated data without downtime?
ACreate new ConfigMaps or Secrets with different names and update pod specs to use them
BUpdate the ConfigMap or Secret and rely on pods to automatically reload the data without restart
CManually delete all pods so they restart and pick up the new data
DUse a rolling update strategy to restart pods gradually with the new ConfigMap or Secret
Attempts:
2 left
💡 Hint
Think about minimizing downtime and ensuring consistency.
tradeoff
advanced
2:00remaining
Tradeoffs of storing secrets in environment variables vs mounted files
What is a key tradeoff when choosing to expose Secrets as environment variables compared to mounting them as files inside containers?
AEnvironment variables are more secure because they are encrypted in memory
BEnvironment variables can be easily viewed in process listings, risking exposure
CMounted files cannot be accessed by the application code
DMounted files allow easier secret rotation without restarting the container
Attempts:
2 left
💡 Hint
Consider how secrets might be exposed inside a running container.
estimation
expert
3:00remaining
Estimating capacity for ConfigMaps and Secrets in a large cluster
You manage a Kubernetes cluster with 1000 microservice pods, each requiring 5 ConfigMaps and 3 Secrets. If each ConfigMap averages 10 KB and each Secret averages 5 KB, estimate the total storage needed for ConfigMaps and Secrets assuming no sharing and no compression.
A65 MB
B80 MB
C100 MB
D50 MB
Attempts:
2 left
💡 Hint
Calculate total size by multiplying counts and sizes, then sum.