Annotations
About 748 words
Every annotation the plugin reads. They all live under metadata.annotations. List values are comma-separated, and spaces around entries are ignored. The catalog doesn't validate them; the backend reads them when it renders a policy, and a malformed one is a diagnostic.
| Annotation | On | Value |
|---|---|---|
backstage.io/kubernetes-namespace | Component, Resource | one namespace |
specht-labs.de/cilium-namespaces | Component, Resource | namespaces |
backstage.io/kubernetes-label-selector | Component, Resource | a label selector |
specht-labs.de/cilium-selector | Component, Resource | a label selector, or * |
specht-labs.de/cilium-ports | Component, Resource, API | ports |
specht-labs.de/cilium-metrics-ports | Component, Resource | ports |
specht-labs.de/cilium-allow | Component, Resource, API | peers: entity:, cidr:, catalog references, * |
specht-labs.de/cilium-dst | API, Component, Resource outside the cluster | peers: entity:, cidr:, fqdn:; or none |
specht-labs.de/tailnet-dst | API | the Tailscale plugin's: where the API is on the tailnet |
specht-labs.de/tailnet-ports | API | the Tailscale plugin's: its ports there |
backstage.io/kubernetes-namespace
backstage.io/kubernetes-namespace: shopThe namespace of the entity's pods. Backstage's Kubernetes plugin reads it too. Together with dependsOn the policy's cluster, it makes the entity an endpoint. Ignored when specht-labs.de/cilium-namespaces is set.
specht-labs.de/cilium-namespaces
specht-labs.de/cilium-namespaces: capi-system, capi-kubeadm-bootstrap-systemThe namespaces of the entity's pods, when there are several. Replaces backstage.io/kubernetes-namespace. Several namespaces render as an In expression on io.kubernetes.pod.namespace.
backstage.io/kubernetes-label-selector
backstage.io/kubernetes-label-selector: app=shopWhich pods in the namespaces are the entity's. Backstage's Kubernetes plugin reads it too. Ignored when specht-labs.de/cilium-selector is set. Without either selector, every pod in the namespaces is the entity's.
specht-labs.de/cilium-selector
specht-labs.de/cilium-selector: app.kubernetes.io/part-of=cert-managerThe entity's pods, for the network policy only, when the Kubernetes plugin's selector doesn't select all of them. * (quoted in YAML) is every pod in the namespaces. The syntax is Kubernetes': k=v, k==v, k!=v, k in (a,b), k notin (a,b), k, !k.
specht-labs.de/cilium-ports
specht-labs.de/cilium-ports: tcp:8080, udp:*The ports the entity is reached on, in the pod, after Service translation. On a Component or Resource with pods, every flow into it uses them unless an API's ports win. On an API, flows to its providers use them, and so do flows to its cilium-dst. On something outside the cluster, flows to its cilium-dst use them. Ports and metrics has the full table.
specht-labs.de/cilium-metrics-ports
specht-labs.de/cilium-metrics-ports: tcp:9090Where the policy's metrics scraper (spec.metrics.scraper) reaches the entity's pods. Only these ports, only from the scraper. Without a scraper in the policy, it does nothing.
specht-labs.de/cilium-allow
specht-labs.de/cilium-allow: entity:kube-apiserver, entity:remote-nodeWho else reaches the entity's pods, or, on an API, the pods of its providers on the cluster, on the ports of the entity or API. Entries are entity:…, cidr:… and catalog references with a kind (component:x, resource:x, api:x), whose pods, or providers' pods, become the source. A catalog reference without a namespace takes the annotated entity's. * is every endpoint of the policy. Not fqdn:. Extra sources has examples.
specht-labs.de/cilium-dst
specht-labs.de/cilium-dst: fqdn:api.github.com, fqdn:*.githubusercontent.comWhere the entity is reached when it isn't on the cluster: fqdn:…, cidr:… or entity:…. Or none, alone: it isn't reached over the network, and the policy stops noting it as a dependency without a destination. Pods on the cluster always win over it. External destinations has examples.
specht-labs.de/tailnet-dst and specht-labs.de/tailnet-ports
specht-labs.de/tailnet-dst: svc:inventory
specht-labs.de/tailnet-ports: tcp:443The annotations of Tailscale for Backstage on an API reached across a tailnet. When a consumer's API has no provider on the cluster and no cilium-dst, but has tailnet-dst, and the policy has spec.tailnetEgress, the consumer reaches the Tailscale egress proxies on the tailnet-ports. The value of tailnet-dst only labels the flow; Tailnet egress explains the rest.
In code
@spechtlabs/backstage-plugin-cilium-common exports every name as a constant (ANNOTATION_CILIUM_PORTS, ANNOTATION_CILIUM_DST and so on), DST_NONE for none, and annotationList(value), which splits a comma-separated value the way the plugin does.
