Add custom Labels and Annotations to Kubernetes resources

  • Release version: Yokohama
  • Updated January 30, 2025
  • 1 minute to read
  • Add custom Labels and Annotations to all resources deployed by Kubernetes Visibility Agent in the Kubernetes cluster.

    Before you begin

    Role required: none

    Procedure

    Do one of the following:
    • When using a Helm chart, in the Helm install command, add the custom attributes to the values.yaml file.

      Use the format shown in this example:

      --set commonLabels.mylabel1=value1 --set commonLabels.mylabel2=value2 --set commonAnnotations.myannotation1=value3.

    • When using the k8s_informer.yaml file, add custom Labels and Annotations manually to the relevant resources in the file.
    Note:

    Label and Annotation names must be alphanumeric and contain no spaces or special characters. For limitations on Label values, see the Kubernetes documentation.