Kustomize
Hard
Mutation
When kustomize edit fix moves commonLabels into labels, which setting does it give the new labels entry?
Select your answer:
Show answer and explanation
Answer: includeSelectors: true
Explanation
commonLabels adds its labels to selectors and pod templates as well as metadata. Setting includeSelectors: true keeps that behavior, so the build output doesn't change and existing Deployments don't hit an immutable selector error on the next apply.
More hard Kustomize questions
- When kustomize edit fix --vars converts a var named DB_HOST, what does it write where $(DB_HOST) appeared in resource files?
- kustomize edit fix --vars stops with an error saying $(DB_HOST) is not delimited. Which env var value causes that?
- Why can a component patch resources defined in the overlay that includes it, when a base can't?
- Which field path selects the value of the env var SERVICE_HOST in the container named app, for a replacement target?
- A production overlay lists a remote base with ?ref=main. What's the risk?
- A strategic merge patch adds one item to a list in a custom resource, but the build replaces the whole list. Why?