Kustomize
Medium
Concepts
How do you add a label to every resource without changing any selectors?
Select your answer:
Show answer and explanation
Answer: Use labels with pairs, leaving includeSelectors at its default of false
Explanation
labels takes a list of entries, each with pairs and options. includeSelectors defaults to false, and includeTemplates adds the labels to pod templates as well. generatorOptions.labels only reaches generated ConfigMaps and Secrets.
More medium Kustomize questions
- What does an images entry with name: nginx and a digest: sha256:... value do?
- A strategic merge patch lists one container with a new image. What happens to the base's other containers?
- How do you remove a container from a base Deployment with a strategic merge patch?
- When is a JSON 6902 patch a better choice than a strategic merge patch?
- A patch target sets kind: Deployment and labelSelector: tier=backend. Which resources does the patch change?
- What are Kustomize components for?