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
<key>: <value>| Part | Description |
|---|---|
<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.
Hidden labels ΒΆ
Nais Console and the Nais API surface all labels on a resource, except for the following internal labels, which are hidden:
| Label key | Match |
|---|---|
app | Exact match |
team | Exact match |
*nais.io/* | Any key containing the substring nais.io/ |
Hidden labels remain present on the underlying Kubernetes resources.
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:
team-area: payments
sensitive: "true"
spec:
...Labels can also be added and edited from Nais Console for Valkey, OpenSearch, Config, and Secret.