Interview Prep/Real-World Interview/Write-a-Kubernetes-manifest tasks

Write a Kustomize overlay that changes replicas and image tag for production.

IntermediateHands-onWrite-a-Kubernetes-manifest tasks
Answer
base/kustomization.yaml       -> resources: [deployment.yaml, service.yaml]
overlays/prod/kustomization.yaml
# overlays/prod/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: prod
resources:
  - ../../base
images:
  - name: myrepo/api
    newTag: "1.5.0"
replicas:
  - name: api
    count: 6
patches:
  - path: resources-patch.yaml

Render: kubectl kustomize overlays/prod or apply with kubectl apply -k overlays/prod.

Key trick → The images and replicas transformers change values without a patch file. CI bumps tags with kustomize edit set image myrepo/api:1.5.1.

All Real-World Interview questions Roadmap: Interview readiness

More on Write-a-Kubernetes-manifest tasks