CertLumen

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?

  1. ACreate the ConfigMap app-settings in the prod namespace
  2. BReference it as default/app-settings in the Pod's configMapKeyRef.name
  3. CGrant the Pod's ServiceAccount a ClusterRole for ConfigMaps
  4. DAdd the label namespace=default to 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

← Previous objective · All 24 objectives · Next objective →