Certified Kubernetes Application Developer (CKAD) · Section 4 · 25% of the exam
Create & consume Secrets
One of the objectives of the Certified Kubernetes Application Developer (CKAD) exam, in the section “Application Environment, Configuration and Security”. Here is what it covers, the points to remember and a question to try.
What it covers
ConfigMaps and Secrets keep configuration out of container images. This lesson shows how to create each one, the ways to consume them (environment variables, envFrom, volumes), what updates automatically and what does not, and the security limits of Secrets.
Points to remember
- ConfigMaps hold non-confidential configuration; Secrets hold sensitive data; both are namespaced and limited to 1 MiB.
- kubectl create configmap/secret generic accepts --from-literal, --from-file (key = file name) and --from-env-file (one key per line).
- Consume them with env valueFrom (configMapKeyRef, secretKeyRef), envFrom (configMapRef, secretRef, optional prefix) or volumes.
- Volume-mounted ConfigMaps and Secrets update eventually; environment variables and subPath mounts never update without a Pod restart.
- A Pod can reference only ConfigMaps and Secrets in its own namespace; a missing required reference blocks the container.
Try a question
A Pod is stuck in CreateContainerConfigError. kubectl describe pod shows Error: configmap "app-settings" not found, although the ConfigMap exists in the default namespace. The Pod is in the prod namespace. What is the fix?
- ACreate the ConfigMap
app-settingsin theprodnamespace - BReference it as
default/app-settingsin the Pod'sconfigMapKeyRef.name - CGrant the Pod's ServiceAccount a ClusterRole for ConfigMaps
- DAdd the label
namespace=defaultto the Pod
Show the answer
A. Namespace boundaries apply to ConfigMaps and Secrets. Mark a reference optional: true only if the Pod can work without it.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson ConfigMaps and Secrets teaches this objective (about 50 minutes), and 14 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Discover and use resources that extend Kubernetes (CRD, Operators)
- Understand authentication, authorization and admission control
- Understand requests, limits, quotas
- Define resource requirements
- Understand ConfigMaps
- Understand ServiceAccounts
- Understand Application Security (SecurityContexts, Capabilities, etc.)