Cilium¶
Cilium is the eBPF-based CNI for every cluster in the platform. It provides pod networking, kube-proxy replacement, Gateway API support, L2 load-balancer announcements, and network observability via Hubble.
Overview¶
Cilium is installed twice, in two different layers:
- Terraform bootstrap (
terraform/environments/hetzner-mgmt-cluster/2-components/main.tf) installs a minimal Cilium release directly via the Helm provider, before Flux exists. Talos nodes have no CNI and no kube-proxy, so the cluster can't schedule anything — including Flux itself — until Cilium is running. - GitOps takeover — once Flux is bootstrapped, the
cilium-configFlux Kustomization applies the fullHelmReleasefromcomponents/cilium-config/, targeting the sameciliumrelease name/namespace. Helm reconciles in place and Flux becomes the source of truth for all subsequent changes.
Cluster DNS is CoreDNS, which Talos installs; how its replicas are kept on different nodes is in CoreDNS.
Dependencies¶
| Dependency | Why |
|---|---|
Gateway API CRDs (gateway-api-crds Kustomization) |
gatewayAPI.enabled requires the CRDs to exist first |
MetalLB (metallb-config Kustomization) |
L2 announcements need MetalLB's IPAddressPool/L2Advertisement in place |
The cilium-config Kustomization declares both as dependsOn.
Exposed Services¶
| Service | Purpose |
|---|---|
| Hubble Relay | Aggregates flow data from all Cilium agents |
| Hubble UI | In-cluster visualization of network flows (no external route by default) |
Repository Layout¶
components/cilium-config/
├── helmrepository.yaml # HelmRepository pointing at https://helm.cilium.io/
├── helmrelease.yaml # HelmRelease with cluster-agnostic defaults
└── kustomization.yaml
components/cilium-config/helmrelease.yaml holds the defaults every cluster shares: kube-proxy replacement, ipam.mode: kubernetes, Hubble enabled, and Gateway API/L7 proxy/L2 announcements disabled. Per the cluster-specific values convention, these feature flags and the k8sServiceHost/cluster.name/cluster.id fields are enabled or overridden per cluster rather than hardcoded in the component.
Cluster wiring¶
Each cluster/<name>/cilium/kustomization.yaml is a Flux Kustomization pointing at ./components/cilium-config, with a strategic-merge patch turning on the cluster's networking mode:
# cluster/hetzner-mgmt/cilium/kustomization.yaml
patches:
- patch: |-
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: cilium
namespace: kube-system
spec:
values:
upgradeCompatibility: "1.18"
cluster:
name: "hetzner-mgmt"
l7Proxy: true
gatewayAPI:
enabled: true
l2announcements:
enabled: true
target:
kind: HelmRelease
name: cilium
Safe Change Workflow¶
- Chart version bumps: edit
chart.spec.versionincomponents/cilium-config/helmrelease.yaml. This affects every cluster — check the Cilium upgrade notes for breaking changes before bumping, and watch the HelmRelease'sremediation.strategy: rollbackbehavior if the upgrade fails health checks. Helm waits (timeout 10m) for theciliumandcilium-envoyDaemonSets and thecilium-operator,hubble-relayandhubble-uiDeployments to become ready, so a rollout whose agents do not come up fails the upgrade and triggers the rollback; never setdisableWait, or a crash-looping upgrade reportsHelm upgrade succeeded. Thecilium-configKustomization's timeout (20m) covers that wait plus a rollback. - Gateway API CRD bumps (
components/gateway-system/crds/): the CRDs must fit the Cilium that runs now, not only the next one.cilium-operatorchecks a fixed list of Gateway API kinds and versions at startup (requiredGVKs/optionalGVKs, inoperator/pkg/gateway-api/cell.goup to 1.19,operator/pkg/gateway-api/helpers/schemes.gofrom 1.20). It matches the version name in the CRD and ignores whether it is served. So Cilium 1.19 breaks on the v1.5+ standardtlsroutesCRD, which listsv1alpha2as not served, while Cilium 1.20 requires TLSRoute, ReferenceGrant and BackendTLSPolicyv1(cilium/cilium#45139). Since v1.5 the bundle also installs thesafe-upgrades.gateway.networking.k8s.ioValidatingAdmissionPolicy, which denies any Gateway API CRD whosebundle-versionis v1.5.x or older, or that is experimental on top of standard. A Git revert to an older bundle therefore fails until a pull request drops the policy and its binding first. - TLSRoute: Cilium 1.20 needs the standard
tlsroutesCRD (v1only), socomponents/gateway-system/crds/installs the whole v1.6.3 bundle. Until 1.20, a delete patch kept it out, because the 1.19 operator does not start its Gateway API controller next to it (see above). webshop kept the same patch incluster/webshop/gateway-system/kustomization.yamlwhile it stepped up from 1.17, and its 1.20 step dropped it, so both clusters now install the whole bundle. A Helm rollback of Cilium to 1.19 therefore leaves the gateway controller down; the way back is a Git revert of both the chart bump and the CRD change, which prunes thetlsroutesCRD (checkkubectl --context <context> get tlsroutes -Ais empty first). upgradeCompatibility: set per cluster to the Cilium minor the cluster was first installed with ("1.18"on hetzner-mgmt and"1.17"on webshop, from their Terraform bootstraps), as the Cilium upgrade guide asks. The chart then keeps that release's defaults where a later one changed them; from 1.20 it keeps Envoy on thesplitxDS mode instead of the newads. Never raise it as part of a chart bump: a changed default is a change of its own. The hetzner-mgmt Terraform bootstrap now installs 1.20.2, so a rebuilt hetzner-mgmt cluster starts on 1.20 defaults (envoy-xds-mode: ads); set itsupgradeCompatibilityto"1.20"in the same change as the rebuild, or Flux's first reconcile switches the new cluster's Envoy back tosplit. The running cluster keeps"1.18".- Socket LB is off (
bpf-lb-sock: "false"in thecilium-configConfigMap). From Cilium 1.20 a pod's connection to a NodePort service through a node address (<node IP>:<nodePort>) is load-balanced as it leaves the pod (cilium/cilium#44507): the pod's egress policy must allow the service's backends, and the backends' ingress policy must allow the pod. Nothing here connects that way today: the only NodePorts belong to the LoadBalancer servicescilium-gateway-shared-gatewayandgitea-ssh, which pods reach through the floating IP. bpf.masqueradeon webshop is off: Talos forwards cluster DNS to its host resolver at169.254.116.108(forwardKubeDNSToHost, on by default for clusters installed with Talos 1.8 or later), and with BPF masquerading Cilium drops CoreDNS's packets to it (drop (FIB lookup failed)), so no pod resolves anything and Flux can no longer fetch Git — see the Talos Cilium guide, known issues, and the 2026-10-27 incident. The webshop patch therefore setsbpf.masquerade: false. Check pod DNS on a new Talos cluster before it takes the component'sbpf.masquerade: true.- A values change can leave the agents on the old config: the component does not set
rollOutCiliumPods, so a change that only alters thecilium-configConfigMap (e.g.bpf.masquerade) gets adeployedHelm revision and a Ready HelmRelease while the running agents keep their old settings. Check the agent withkubectl --context <context> -n kube-system exec ds/cilium -c cilium-agent -- cilium-dbg status. If it still shows the old setting, delete the agent pods one node at a time (kubectl --context <context> -n kube-system delete pod <cilium-pod>) and wait for each to be Ready, as in the 2026-10-27 recovery. - Shared defaults (e.g. Hubble metrics,
bpf.masquerade,policyEnforcementMode): editvaluesincomponents/cilium-config/helmrelease.yamldirectly — these apply to all clusters. - Per-cluster behavior (enabling Gateway API, L2 announcements, L7 proxy, or changing
k8sServiceHost/cluster.name/cluster.id): add or edit thepatchesblock in that cluster'scluster/<name>/cilium/kustomization.yaml. Never hardcode a cluster-specific value in the component. - Because Cilium also exists outside GitOps (the Terraform bootstrap install), a chart version bump that changes CRDs or requires a specific upgrade path should also be reflected in the hardcoded version in
terraform/environments/hetzner-mgmt-cluster/2-components/main.tfif a new cluster would otherwise bootstrap with a stale version before Flux takes over. Cilium only tests upgrades between consecutive minors, so keep that pin on the minor Flux runs (today 1.20.2). Changing the pin never needs an apply on the running cluster: Flux owns the release there. - After merging, confirm the
cilium-configKustomization and theciliumHelmRelease reportReady(flux --context <context> get kustomizations,flux --context <context> get helmreleases -n kube-system) before considering the change deployed — a failed Cilium upgrade can take down pod networking cluster-wide. The component runs on every cluster, so check each one, with its kubeconfig context in place of<context>(rules of engagement, rule 8).