liveBook · Manning

Kustomize

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

Kustomize is a Kubernetes-native configuration customization tool that composes and transforms resource manifests without requiring templating.

Kustomize is a declarative Kubernetes configuration tool that manages existing YAML manifests without templating. It is integrated into kubectl, supports reusable bases and environment-specific overlays, and helps keep configurations DRY. section 5.3 section 5.3.2

Use Kustomize to organize and apply Kubernetes configurations:

  • Create a base directory containing resource manifests such as a Deployment and Service. section 5.3.2
  • Add kustomization.yaml and list the resources it manages. section 5.3.2
  • Apply the base with kubectl apply -k base/. section 5.3.2
  • Verify the resulting resources with kubectl get deploy,svc. section 5.3.2
  • Create overlays that modify the base for staging, production, or development without duplicating the underlying YAML. section 5.3.2

Staging overlay with three replicas

A staging kustomization can reference ../../base and apply a patch targeting Deployment my-app. A JSON patch replaces /spec/replicas with 3, changing the environment-specific desired state while preserving the shared base.

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains bases, overlays, patches, application, and verification, while stopping short of package management and dependency handling.
Examples
Uses Deployment and Service manifests, a base kustomization, and a staging patch that raises replicas to three.
What it assumes
Assumes existing Kubernetes YAML manifests and basic resources, then teaches kustomization.yaml files, bases, overlays, and patches.
What you can do after
Apply it via kubectl, customize environment overlays, and verify resulting Deployments and Services.
How it connects
Connects Kubernetes YAML manifests with kubectl, Helm, GitOps, Deployments, Services, and overlays.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.