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