bedrock
tenant layer

Policy labels

Cilium policies pick pods by label. If a pod loses one of the labels below, or a new pod is deployed without it, the policies stop recognising it and its traffic is dropped. Before relabelling a platform workload, find it here and update the policies in netpols/ at the same time.

Cilium writes the namespace as the label k8s:io.kubernetes.pod.namespace, so a peer is often a namespace and a label together.

Labels selected inside a namespace

These labels pick which pods a rule applies to.

NamespaceLabelPodsPolicy file
applicationapp.kubernetes.io/name: prometheusPrometheusapplication.yaml
applicationapp.kubernetes.io/name: alertmanagerAlertmanagerapplication.yaml
applicationapp: grafanaGrafanaapplication.yaml
applicationapp: lokiLokiapplication.yaml
applicationapp: tempoTempoapplication.yaml
applicationapp: opencostOpenCostapplication.yaml
applicationapp: kube-state-metricskube-state-metricsapplication.yaml
applicationapp: blackbox-exporterBlackbox exporterapplication.yaml
garageapp: garageGarage nodesgarage.yaml
garageapp: garage-initThe bucket setup Jobgarage.yaml
kube-systemk8s-app: kube-dnsCoreDNSkube-system.yaml

The other namespaces apply one policy to every pod in them, so their pods need no particular label.

Labels other namespaces rely on

These labels are named as peers by policies in other namespaces.

NamespaceLabelAllowed to reach it, or reached by it
kube-systemk8s-app: kube-dnsEvery pod, for DNS
applicationapp.kubernetes.io/name: prometheusScrapes every namespace that exposes metrics
applicationapp: blackbox-exporterProbes Garage, Kyverno, CloudNativePG and the database clusters
applicationapp: lokiReaches Garage; receives logs from Alloy
applicationapp: tempoReaches Garage; receives traces from Alloy
node-agentsapp: alloySends to Loki and Tempo
longhorn-systemapp: longhorn-managerScraped by Prometheus
kyvernoapp.kubernetes.io/component: admission-controllerProbed by the blackbox exporter
cnpg-systemapp.kubernetes.io/name: cloudnative-pgScraped and probed from application
garageapp: garageScraped by Prometheus

Labels set by operators

Some of these labels are set by an operator, not by the repository. Prometheus and Alertmanager get theirs from the Prometheus operator, the database pods from CloudNativePG and the Kyverno and CloudNativePG controllers from their release manifests. An operator upgrade that changed them would cut those pods off, so check the labels after upgrading one:

kubectl -n application get pods --show-labels