Kustomize Overlays
base/ holds a Deployment and a Service. Production needs 5 replicas and the image tag 2.4.1, without copying the base manifests. What is the Kustomize way?
base/
2.4.1
Choose one answer
An overlay that lists ../../base with replicas and images, applied with -k.
../../base
replicas
images
-k
Put values.yaml with replicas: 5 in overlays/prod/ and run kubectl apply -k overlays/prod.
values.yaml
replicas: 5
overlays/prod/
kubectl apply -k overlays/prod
Keep base/ on main and a prod branch where deployment.yaml has the production values.
main
prod
deployment.yaml
Run kubectl kustomize base --set replicas=5,image=2.4.1 | kubectl apply -f - in the pipeline.
kubectl kustomize base --set replicas=5,image=2.4.1 | kubectl apply -f -