CertLumen

Certified Kubernetes Application Developer (CKAD) · Section 2 · 20% of the exam

Kustomize

One of the objectives of the Certified Kubernetes Application Developer (CKAD) exam, in the section “Application Deployment”. Here is what it covers, the points to remember and a question to try.

What it covers

Kustomize customizes plain YAML without templates. A kustomization.yaml lists resources and transformations such as name prefixes, labels, images, patches and generated ConfigMaps. Overlays reuse a base for each environment. kubectl has it built in through apply -k and kubectl kustomize.

Points to remember

  • Kustomize layers changes over plain YAML; it needs a directory with kustomization.yaml and is built into kubectl.
  • kubectl kustomize DIR only renders; kubectl apply -k DIR applies; kubectl diff -k, get -k and delete -k also work.
  • resources replaces the old bases field; patches replaces patchesStrategicMerge and patchesJson6902; labels replaces commonLabels.
  • namePrefix, nameSuffix, namespace, images, replicas and commonAnnotations are the common transformers.
  • A JSON 6902 patch needs a target; a strategic merge patch names the object by kind and metadata.name.

Try a question

A kustomization contains namePrefix: dev- and the base has a Deployment named web. What is the name of the Deployment created by kubectl apply -k?

  1. Adev
  2. Bweb
  3. Cweb-dev
  4. Ddev-web
Show the answer

D. namePrefix and nameSuffix change names of all resources, and Kustomize rewrites references to them.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Customizing Manifests with Kustomize teaches this objective (about 40 minutes), and 12 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 →