Label reference ΒΆ
Labels are user-defined key-value pairs used to organize and categorize your resources. See the labels explanation for background.
Format ΒΆ
A label consists of a key and a value:
Plaintext
labels.nais.io/<key>: <value>| Part | Description |
|---|---|
labels.nais.io/ | Required prefix. It is the only constraint Nais adds on top of the standard Kubernetes label rules. |
<key> | Your label name. Must follow the Kubernetes label syntax. |
<value> | Your label value. Must follow the Kubernetes label syntax. |
Behavior ΒΆ
- Labels are kept verbatim β Nais does not rewrite or strip them.
- Labels are propagated to the underlying Kubernetes resources that the resource owns.
- Labels carry no special meaning to Nais. They are only used for your own organization.
Setting labels ΒΆ
Labels are defined under metadata.labels for any Kubernetes resource that Nais supports:
yaml
apiVersion: nais.io/v1alpha1
kind: Application
metadata:
name: myapplication
namespace: myteam
labels:
labels.nais.io/team-area: payments
labels.nais.io/sensitive: "true"
spec:
...Labels can also be added and edited from Nais Console for Valkey, OpenSearch, Config, and Secret.