Skip to content

Komodor Kubernetes Annotations

Komodor annotations enable users to create static and dynamic hyperlinks to other solutions and resources.

For example, you can use Annotations to provide hyperlinks to the following:

  • Source Control like Git
  • DevOps tools
  • Monitoring and observability
  • Integrated solutions

Where does Komodor utilize annotations?

Komodor uses these annotations to enrich service information and creates powerful connections between services.

  • Services explorer
  • Related services
  • Events screen
  • Matching alerts to the correct services

There are annotations you can declare in a Deployment manifest that will populate specific dashboards within Komodor.

Deploy Links Service Links

The Yaml Path is metadata.annotations

  annotations: '' ''

Komodor Annotations provide links from the Troubleshooting components for Deployments and Services

  • The Deployment Details of a Deployment Event
  • The Info tab of the Service

Komodor annotations should be placed in the deployment resource annotations (annotations set on the pod template are ignored)

Annotation links have different types:

  • Deploy
  • Job
  • Service


For each deployment version, you can add a quick link with the relevant filters already in place!


Annotation Values Description Example url Link for the specific version logs url Link for the specific version Sentry issues

Job Example:

Annotation Values Description Example url Link to Jenkins job that deploys the service


Annotation Values Description Example url Link for the specific version logs url Link for the specific version Sentry issues

You can create custom links to external and internal applications by crafting your own URL to the application using a skeleton URL and placeholders provided by Komodor. Just copy the URL of the application you want to link to, identify the placeholders in the URL that are used to query the application, and replace them with placeholders for your own use. Please find the below examples as references for common applications.

Custom Format[deploy|service]


Annotation Values Description Example url Link for the custom URL, coralogix${cluster}%22))%20AND%20(coralogix.metadata.namespace:(%22${namespace}%22))%20AND%20(coralogix.metadata.service:(%22${service}%22))&time=from:${timestampStart=yyyy-MM-dd'T'HH:mm:ss.SSS},to:${timestampEnd=yyyy-MM-dd'T'HH:mm:ss.SSS} url Link for the custom URL,!(message,kubernetes.namespace_name,kubernetes.container_name,params.clusterName),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'logzioCustomerIndex',key:kubernetes.namespace_name,negate:!f,params:(query:default),type:phrase),query:(match_phrase:(kubernetes.namespace_name:${namespace}))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'logzioCustomerIndex',key:params.clusterName,negate:!f,params:(query:main),type:phrase),query:(match_phrase:(params.clusterName:${cluster}))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'logzioCustomerIndex',key:kubernetes.container_name,negate:!f,params:(query:k8s-events-collector),type:phrase),query:(match_phrase:(kubernetes.container_name:${service})),query:(match_phrase:(kubernetes.container_image:${container[web].image})))),index:'logzioCustomerIndex',interval:auto,query:(language:lucene,query:''),sort:!(!('@timestamp',desc)))&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'${timestampStart=yyyy-MM-dd'T'HH:mm:ss.SSS}',to:'${timestampStart=yyyy-MM-dd'T'HH:mm:ss.SSS}'))&discoverTab=logz-logs-tab&switchToAccountId=138828&accountIds=true url Link for the custom URL, DataDog${service}%20kube_namespace%3A${namespace}%20env%3A${cluster}&cols=core_service%2Ccore_resource_name%2Clog_duration%2Clog_http.method%2Clog_http.status_code&historicalData=true&messageDisplay=inline&sort=desc&streamTraces=true&start=${epochStart}&end=${epochEnd}&paused=true

The following values can be used to enrich the URL:

Placeholder Value Example
${epochStart} Start Time in Epoch Time
${epochEnd} End Time in Epoch Time
${service} Service Name
${namespace} Namespace Name
${cluster} Cluster Name
${failedPod} * The pod name of a failed pod that triggered this health event*
${container[<name>].image} ** Image name of a container ${container[web].image}
${timestampStart=yyyy-MM-dd'T'HH:mm:ss.SSS} Start Time in custom format*** ${timestampStart=yyyy-MM-dd}
${timestampEnd=yyyy-MM-dd'T'HH:mm:ss.SSS} End Time in custom format*** ${timestampEnd=yyyy-MM-dd}
${yaml[<spec_path>]} Full yaml's path specification ${yaml[]}

*Not applicable in Service context. **Custom links with a failed pod name will be created on health events only. ***Dates can be crafted using the display guidelines of date-fns

Example on how to use YAML full path:

  replicas: 5
      app: nginx
      - name: test
      image: nginx:1.14.2
        - containerPort: 80
      - name: test2
        image: nginx:1.14.2
        - containerPort: 80
      lables: nginx helm 
YAML Path Value Explanation
${yaml[spec.replicas]} 5 full path usage
${yaml[spec.template.spec.containers[0].name]} test full path usage using path index
${yaml[spec.my_replicas]} undefined path doesn't exist
${yaml[spec.template.spec.containers]} undefined path doesn't resolve to an actual value
${yaml[spec.metadata.template.labels['']]} nginx full path usage using dictionary key

Full example

apiVersion: apps/v1
kind: Deployment
  name: annotation-example
  annotations: "" "" "" "" "" "" "${service}%20kube_namespace%3A${namespace}%20env%3A${cluster}&cols=core_service%2Ccore_resource_name%2Clog_duration%2Clog_http.method%2Clog_http.status_code&historicalData=true&messageDisplay=inline&sort=desc&streamTraces=true&start=${epochStart}&end=${epochEnd}&paused=true"
      run: example
  replicas: 1
        run: example
        - name: hello-world
            - containerPort: 8080
              protocol: TCP

Annotations Best Practices

At Komodor we believe that k8s annotations are the best method for describing services metadata. This includes all the “extra” fields used to tag and label your services, both for other team members and for external tools. BTW, We collect data from both annotations and labels.

Official Kubernetes recommendations database wordpress helm

Komodor recommendations backend infrastructure "infa-team" "devs" redis

Usage example

  • Tagging Team annotations on relevant services and adding relevant metadata on the alert metadata in datadog.
  • Using the Team name in the alert tools (for example PagerDuty) as part of the Komodor labels.