1.7 KiB
title, linkTitle, type, weight, description
| title | linkTitle | type | weight | description |
|---|---|---|---|---|
| labels | labels | docs | 10 | Add labels and optionally selectors to all resources. |
apiVersion: kustomize.config.k8s.io/v1beta1
See the Tasks section for examples of how to use labels.
labels
Adds labels and optionally selectors to all resources.
-
labels ([]Label)
List of labels and label selector options.
Label holds labels to add to resources and options for customizing how those labels are applied, potentially using selectors and template metadata.
-
pairs (map[string]string)
Map of labels that the transformer will add to resources.
-
includeSelectors (bool), optional
IncludeSelectors indicates whether the transformer should include the fieldSpecs for selectors. Custom fieldSpec specified by
fieldswill be merged with builtin fieldSpecs if this is true. Defaults to false. -
includeTemplates (bool), optional
IncludeTemplates indicates whether the transformer should include the
spec/template/metadatafieldSpec. Custom fieldSpecs specified byfieldswill be merged with thespec/template/metadatafieldSpec if this is true. If IncludeSelectors is true, IncludeTemplates is not needed. Defaults to false. -
fields ([][FieldSpec]({{< relref "../Common%20Definitions/FieldSpec.md" >}})), optional
Fields specifies the field on each resource that LabelTransformer should add the label to. It essentially allows the user to re-define the field path of the Kubernetes labels field from
metadata/labelsfor different resources.
-