k8wiz
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.