bedrock

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 tenant-workload/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
openbaoapp: openbaoOpenBao, for its raft peersopenbao.yaml
secrets-storeapp: csi-secrets-storeThe CSI driversecrets-store.yaml
secrets-storeapp.kubernetes.io/name: openbao-csi-providerThe OpenBao CSI providersecrets-store.yaml
kube-systemk8s-app: kube-dnsCoreDNSkube-system.yaml
bedrock-failoverapp.kubernetes.io/name: bedrock-observerBoth observer DaemonSetstenant-workload/failover/netpol.yaml
bedrock-failoverapp.kubernetes.io/name: bedrock-verifierThe verifiertenant-workload/failover/netpol.yaml
bedrock-failoverapp.kubernetes.io/name: bedrock-checkerThe checkertenant-workload/failover/netpol.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
secrets-storeapp.kubernetes.io/name: openbao-csi-providerReaches OpenBao on 8200
openbaoapp: openbaoReached by the OpenBao CSI provider, reaches the database clusters on 5432
bedrock-failoverapp.kubernetes.io/name: bedrock-observerReaches the database instances on 5432
bedrock-failoverapp.kubernetes.io/name: bedrock-verifierReaches the database instances on 5432 and 8000
bedrock-failoverapp.kubernetes.io/name: bedrock-checkerReaches the database instances on 8000

The failover controller’s pods also carry bedrockctl.com/observer-slot (a or b) on the observers, which admission reads to tell the two observers on a node apart.

#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:

shell
kubectl -n application get pods --show-labels