Skip to content

Kubernetes Annotations Reference

The Shoehorn K8s Agent reads annotations and labels from Kubernetes workloads to enrich entity metadata in the service catalog. This document covers all supported annotations.

Point to a manifest file in your repo for full entity enrichment (relations, links, runbooks, licenses, interfaces). The API fetches it server-side - no structured data stored in K8s.

annotations:
# Relative path (resolved against known repo URL from ArgoCD/Flux/crawler)
shoehorn.dev/entityFile: ".shoehorn/catalog.yaml"
# Full URL (for files in a different repo)
shoehorn.dev/entityFile: "https://github.com/acme/shared-configs/blob/main/.shoehorn/checkout.yaml"
# Multi-service file with fragment selector
shoehorn.dev/entityFile: ".shoehorn/platform.yaml#checkout-api"

For details on manifest file format and enrichment modes, see Entity Enrichment Modes.


These annotations determine which team owns a workload. They are checked in priority order (first match wins):

Key Type Priority Example
shoehorn.dev/owner Label or Annotation 1 platform-engineering
shoehorn.dev/team Label or Annotation 2 infrastructure-team
owner Label or Annotation 3 payments-team
app.kubernetes.io/owner Label only 4 data-team

If no annotation matches, the agent attempts namespace pattern matching (e.g., platform-team-production extracts platform). The final fallback is unassigned.

# Recommended approach
labels:
shoehorn.dev/owner: "payments-team"

Provides a human-readable description for the entity.

Key Priority
shoehorn.dev/description 1
description 2
app.kubernetes.io/description 3
annotations:
shoehorn.dev/description: "Handles payment processing and card transactions"

By default Shoehorn sets the catalog entity’s type to the lowercased Kubernetes kind: a Deployment becomes deployment, a StatefulSet becomes statefulset, a Job becomes job, and so on. To classify a workload differently, set shoehorn.dev/type to any kebab-case value up to 32 characters.

Key Format
shoehorn.dev/type Lowercase, starts with a letter, max 32 chars (^[a-z][a-z0-9-]{0,31}$)
annotations:
shoehorn.dev/type: "api"

Invalid values are silently ignored and the kind-based default is used. The agent does not fail the sync on a malformed override.

Shoehorn groups workloads into one service by a key it reads from labels, in this order:

  1. shoehorn.dev/service, if you set it. The namespace is left out of the identity: workloads in different namespaces and clusters with the same value become one service.
  2. app.kubernetes.io/name, with app.kubernetes.io/component appended when the chart sets it and the name doesn’t already end with it. The namespace stays in the identity. Helm charts label every workload with the chart name and tell them apart by component, so shoehorn-api and shoehorn-worker are two services, not one. A chart that already puts the role in the name, like ArgoCD’s argocd-server with component server, keeps argocd-server.
  3. The workload name.

The same key in the same namespace on two clusters is one service with two cluster presences. app.kubernetes.io/instance is not part of the key. It holds the release name, which often differs per environment, and using it would split one service across clusters. Two installs of one chart in the same namespace that share name and component are grouped together; give each install its own shoehorn.dev/service to keep them apart.

Key Format
shoehorn.dev/service Any value. Lowercased; characters outside a-z, 0-9 and - become -
annotations:
shoehorn.dev/service: "checkout"

The catalog entity’s ID follows the key: k8s-svc-<kind>-<key> for the annotation, k8s-<namespace>-<kind>-<key> otherwise. The key is lowercased, characters outside a-z, 0-9 and - become -, and a key that would push the ID past 200 characters is shortened with a short hash at the end. A workload whose object name is exactly <name label>-<component label> (what a Helm chart produces when the release name equals the chart name) keeps the ID it had before grouping existed; any other workload gets a new ID, and the old entity is removed on the next sync. Tags, links, and owners you set on a removed entity are not carried over.

Comma-separated tags for categorizing entities.

Key Format
shoehorn.dev/tags Comma-separated values
annotations:
shoehorn.dev/tags: "critical, financial, pci-compliant"

The agent also automatically adds tags from:

  • Cluster metadata: cluster:<name>, env:<environment>, provider:<provider>, region:<region>
  • Kubernetes labels: app, app.kubernetes.io/name, app.kubernetes.io/component, app.kubernetes.io/part-of

Link entities to external tools and dashboards. All link annotations use the link.shoehorn.dev/ prefix.

annotations:
link.shoehorn.dev/argocd-url: "https://argocd.example.com/applications/my-app"
link.shoehorn.dev/argocd-name: "ArgoCD Application" # Optional, default: "ArgoCD"
link.shoehorn.dev/argocd-icon: "argocd" # Optional, default: "argocd"
annotations:
link.shoehorn.dev/grafana-url: "https://grafana.example.com/d/abc123"
link.shoehorn.dev/grafana-name: "Service Metrics" # Optional, default: "Grafana Dashboard"
link.shoehorn.dev/grafana-icon: "grafana" # Optional, default: "grafana"
annotations:
link.shoehorn.dev/prometheus-url: "https://prometheus.example.com"
link.shoehorn.dev/prometheus-name: "Metrics Query" # Optional, default: "Prometheus Metrics"
link.shoehorn.dev/prometheus-icon: "prometheus" # Optional, default: "prometheus"
annotations:
link.shoehorn.dev/url: "https://docs.example.com/my-service"
link.shoehorn.dev/name: "Documentation" # Optional, default: "Custom Link"
link.shoehorn.dev/icon: "docs" # Optional, default: "link"

Add numbered suffixes for additional links:

annotations:
# First link (no suffix)
link.shoehorn.dev/url: "https://docs.example.com"
link.shoehorn.dev/name: "Documentation"
link.shoehorn.dev/icon: "docs"
# Second link
link.shoehorn.dev/url.2: "https://status.example.com"
link.shoehorn.dev/name.2: "Status Page"
link.shoehorn.dev/icon.2: "dashboard"
# Third link
link.shoehorn.dev/url.3: "https://runbook.example.com"
link.shoehorn.dev/name.3: "Runbook"
link.shoehorn.dev/icon.3: "docs"

Icons are case-insensitive. Supported values:

Category Icons
Source Control github, gitlab
Monitoring grafana, datadog, prometheus, sentry, jaeger
CI/CD argocd, jenkins
Cloud aws, azure, gcp, kubernetes, k8s, docker, dockerhub, terraform
Communication slack, discord, teams, zoom
Project Management jira, linear, pagerduty
Documentation confluence, notion, docs, wiki
Generic api, database, dashboard, monitor, source, repository, repo, url, link, external, code, http
Key Values
shoehorn.dev/zombie-exempt "true" keeps the workload off the zombie list. "false" puts it on the list even in a namespace Shoehorn treats as platform infrastructure.

The annotation wins over every other rule. See Excluding a workload.

Define APIs and contracts for the entity.

annotations:
shoehorn.dev/interface.http.openapi: "https://api.example.com/openapi.json"
shoehorn.dev/interface.http.base-url: "https://api.example.com/v1" # Optional
shoehorn.dev/interface.http.version: "2.0.0" # Optional
annotations:
shoehorn.dev/interface.grpc.protos: "https://example.com/user.proto, https://example.com/auth.proto"
shoehorn.dev/interface.grpc.package: "com.example.api" # Optional
shoehorn.dev/interface.grpc.services: "UserService, AuthService" # Optional
annotations:
shoehorn.dev/interface.graphql.schema: "https://example.com/schema.graphql"
annotations:
shoehorn.dev/interface.events.asyncapi: "https://example.com/asyncapi.yaml"

The legacy shoehorn.dev/definition-url annotation is supported for backward compatibility and maps to interface.http.openapi. New annotations take precedence.

annotations:
shoehorn.dev/definition-url: "https://api.example.com/openapi.json"

A production deployment with all annotation categories:

apiVersion: apps/v1
kind: Deployment
metadata:
name: payment-service
namespace: production
labels:
app: payment-service
shoehorn.dev/owner: "payments-team"
annotations:
# Description
shoehorn.dev/description: "Handles payment processing and card transactions"
# Tags
shoehorn.dev/tags: "critical, financial, pci-compliant"
# External links
link.shoehorn.dev/argocd-url: "https://argocd.example.com/applications/payment-service"
link.shoehorn.dev/grafana-url: "https://grafana.example.com/d/payment-metrics"
link.shoehorn.dev/url: "https://wiki.example.com/payment-service"
link.shoehorn.dev/name: "Wiki"
link.shoehorn.dev/icon: "wiki"
# Interfaces
shoehorn.dev/interface.http.openapi: "https://api.example.com/payment/openapi.json"
shoehorn.dev/interface.http.base-url: "https://api.example.com/payment/v1"
shoehorn.dev/interface.grpc.protos: "https://repo.example.com/protos/payment.proto"
shoehorn.dev/interface.grpc.services: "PaymentService, RefundService"
spec:
replicas: 3
selector:
matchLabels:
app: payment-service
template:
metadata:
labels:
app: payment-service
spec:
containers:
- name: payment-service
image: ghcr.io/example/payment-service:v1.2.0
Annotation Purpose UI Location
shoehorn.dev/entityFile Manifest file for full enrichment All entity fields
shoehorn.dev/type Override the kind-derived entity type Entity type field
shoehorn.dev/service Group workloads into one service across namespaces and clusters Operations drawer, entity ID
shoehorn.dev/owner Team ownership Entity owner field
shoehorn.dev/description Service description Entity description
shoehorn.dev/tags Categorization tags Entity tags
shoehorn.dev/zombie-exempt Keep a workload off the zombie list, or put it on Zombie list
link.shoehorn.dev/argocd-url ArgoCD link External links
link.shoehorn.dev/grafana-url Grafana link External links
link.shoehorn.dev/prometheus-url Prometheus link External links
link.shoehorn.dev/url Custom link External links
link.shoehorn.dev/url.N Additional custom links External links
shoehorn.dev/interface.http.openapi OpenAPI spec URL Interfaces tab
shoehorn.dev/interface.http.base-url HTTP base URL Interfaces tab
shoehorn.dev/interface.http.version API version Interfaces tab
shoehorn.dev/interface.grpc.protos gRPC proto URLs Interfaces tab
shoehorn.dev/interface.grpc.package gRPC package Interfaces tab
shoehorn.dev/interface.grpc.services gRPC service names Interfaces tab
shoehorn.dev/interface.graphql.schema GraphQL schema URL Interfaces tab
shoehorn.dev/interface.events.asyncapi AsyncAPI spec URL Interfaces tab
shoehorn.dev/definition-url Legacy OpenAPI URL Interfaces tab