Kustomize
Hard
Troubleshooting
An overlay sets replicas for a Deployment that a HorizontalPodAutoscaler scales. What happens on each kubectl apply -k?
Select your answer:
Show answer and explanation
Answer: Each apply resets spec.replicas to the overlay's value
Explanation
Kustomize writes spec.replicas into the Deployment, and every apply sets it back to that number, which can remove Pods the HPA added. Leave replicas out of the manifests of autoscaled workloads and let the HPA own the field.
More hard Kustomize questions
- A configMapGenerator entry has files: [config/app.properties]. Which key holds the file's content?
- labels sets includeSelectors: false and includeTemplates: true. Where do the labels end up?
- What does the openapi field in a kustomization.yaml provide?
- Two bases included by one overlay both define a ConfigMap named settings in the same namespace. What happens?
- A JSON 6902 patch adds an annotation named example.com/owner. How is that key written in the patch path?
- Why can a kustomization build with the kustomize CLI but fail with kubectl apply -k?