Challenge - 5 Problems
Secret Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of kubectl create secret generic command
What is the output of this command when creating a secret named
mysecret with a literal key-value pair?Kubernetes
kubectl create secret generic mysecret --from-literal=username=adminAttempts:
2 left
💡 Hint
Think about what kubectl reports when a new secret is successfully created.
✗ Incorrect
The command creates a new secret named 'mysecret' and kubectl outputs 'secret/mysecret created' to confirm success.
🧠 Conceptual
intermediate2:00remaining
Base64 encoding in Kubernetes Secrets
Why does Kubernetes require secret data to be base64 encoded in YAML manifest files?
Attempts:
2 left
💡 Hint
Think about how YAML files handle binary or special characters.
✗ Incorrect
Base64 encoding allows binary or special characters to be safely represented as plain text in YAML files, avoiding parsing errors.
❓ Configuration
advanced3:00remaining
Correct YAML for a Kubernetes Secret with two keys
Which YAML manifest correctly creates a secret named
db-secret with keys username and password base64 encoded?Attempts:
2 left
💡 Hint
Check which field requires base64 encoded values and which accepts plain text.
✗ Incorrect
The 'data' field requires base64 encoded values. Option B correctly uses 'data' with base64 encoded strings. Option B uses 'stringData' with plain text, which is valid but does not match the question requirement for base64 encoded keys.
❓ Troubleshoot
advanced3:00remaining
Troubleshooting secret not found error in Pod
A Pod fails to start with error:
secret "mysecret" not found. Which is the most likely cause?Attempts:
2 left
💡 Hint
Remember that Kubernetes resources are namespace-scoped unless specified otherwise.
✗ Incorrect
Secrets are namespace-scoped. If the Pod is in a different namespace than the secret, it cannot access it, causing the 'not found' error.
🔀 Workflow
expert4:00remaining
Order of steps to update a Kubernetes Secret safely
What is the correct order of steps to update a Kubernetes Secret without downtime for Pods using it?
Attempts:
2 left
💡 Hint
Think about how to avoid downtime by updating secrets and Pods in a controlled sequence.
✗ Incorrect
First create a new secret with a new name, then update Pod specs to use it, apply the changes to trigger rolling update, and finally delete the old secret once Pods use the new one.