CILIUM · CILIUM: UP AND RUNNING · CHAPTER 16

Operations

Install, upgrade, monitor and troubleshoot Cilium without surprises.

8 min readBook: Cilium: Up and RunningLevel: intermediate

From point A to point B

Point A: you know how to install and configure Cilium in a lab. Point B: by the end of this last chapter you'll know how to run it in production: install it declaratively, upgrade it without surprises, migrate from another CNI, monitor its health and troubleshoot problems, knowing what breaks when something fails.

CLI or Helm, and Helm with GitOps

The Cilium CLI is great for learning, troubleshooting and querying. To install and change the configuration in production, the recommendation is Helm, for two reasons:

  • The CLI hides the configuration it applies. Helm keeps it written down in a values file you can read and understand.
  • Imperative commands from a laptop don't scale. Serious infrastructure is declarative and reproducible.

Use the CLI freely for anything that doesn't change the cluster: cilium status, cilium bgp peers, cilium connectivity test, cilium sysdump.

Running Helm by hand from a laptop requires cluster admin permissions and leaves no history of the values. The best approach is to keep them in Git and let Argo CD or Flux apply them:

Managing Cilium with Helm and GitOps Helm values live in Git. A change goes through a pull request and review. Argo CD or Flux, ideally running in a separate management cluster, applies the Helm release to the target cluster. If GitOps runs inside the same cluster, a broken Cilium can also break the tool that should fix it. Gitvalues-cilium.yaml pull requestreview · history Argo CD / Fluxmanagement cluster target clusterhelm release cilium GitOps inside the same cluster: a broken CNI can break the fixer declarative · reproducible · reversible

Values in Git, reviewed changes, automatic apply. Diagram: The House of Routing.

  • Chicken and egg: the GitOps tool needs a network to work, and the network is Cilium. One option is to bootstrap from a temporary cluster (kind, for example) or to manage the clusters from a separate management cluster.
  • Deadlock: if GitOps manages the Cilium of its own cluster and an upgrade breaks the network, it also breaks the tool that should fix it. Always have a plan to apply Helm by hand.
  • Install order: Cilium's CRDs are created by the operator. Don't apply Cilium resources (pools, policies, BGP) before the operator has started at least once.

Upgrades

Cilium ships a minor release roughly every six months and maintains patches for the last three. Treat it as critical infrastructure, just like a Kubernetes upgrade:

  1. Read the upgrade notes for the target version.
  2. First move to the latest patch of your current minor version.
  3. Run the preflight: it pulls the new images on every node and validates the configuration before touching anything.
  4. Upgrade one minor version at a time, first on a non-critical cluster.
# 1 · Preflight: pre-pull images on every node
helm install cilium-preflight cilium/cilium --version 1.20.3 -n kube-system \
  --set preflight.enabled=true --set agent=false --set operator.enabled=false
kubectl -n kube-system rollout status daemonset/cilium-pre-flight-check
helm uninstall cilium-preflight -n kube-system

# 2 · Upgrade with the same values versioned in Git
helm upgrade cilium cilium/cilium --version 1.20.3 -n kube-system -f values-cilium.yaml
cilium status --wait
cilium connectivity test

There's an alternative: don't upgrade, but create a new cluster with the new version and move the workloads. It demands a lot of maturity from the rest of the platform, but it removes the risk of an in-place upgrade.

What happens while the agent restarts

What happens while the agent restarts While a Cilium agent restarts, the eBPF programs and maps stay in the kernel, so pod routing, services and layer 3 and 4 policy keep working, although the maps are not updated. Features that depend on the agent or on Envoy pause: DNS policy through the DNS proxy, layer 7 policy, Ingress and Gateway API through Envoy, and BGP sessions run by the agent, unless graceful restart keeps the routes. KEEPS WORKING · EBPF PAUSES · AGENT OR ENVOY pod-to-pod routing, inside and across nodes services · ClusterIP · NodePort · LoadBalancer layer 3/4 policy · CIDR · entities but the maps are frozen: no new backends or policies DNS / FQDN policy · DNS proxy in the agent L7 policy · Ingress · Gateway API · Envoy BGP sessions · unless graceful restart new pods on that node · no CNI preflight pre-pulls images · test on a non-critical cluster first

What lives in the kernel keeps going; what depends on the agent or on Envoy stops. Diagram: The House of Routing.

  • Keeps working: pod routing, services and layer 3/4 policies, because the eBPF programs and maps stay in the kernel (you checked this in chapter 6).
  • Risk: the maps are frozen. If the only backend of a service dies right then, the client may get errors until the agent comes back.
  • Stops: DNS and FQDN policies (the DNS proxy lives in the agent), BGP sessions (unless you use graceful restart) and the creation of new pods on that node, because the CNI doesn't respond.
  • Envoy: Ingress, Gateway API and layer 7 policies depend on the cilium-envoy DaemonSet. While its pod is being replaced, new and existing connections on that node are lost.

To shorten the window: preflight so the image is already pulled, and testing beforehand so you don't discover a configuration error in production. Shortening isn't eliminating: there will always be a few seconds between a pod starting and being ready.

Migrating from another CNI

You can move from Flannel, Calico or the AWS CNI to Cilium without rebuilding the cluster, but there's no single path:

StrategyHow it worksKeep in mind
New clusterYou create a cluster with Cilium and redeploy the workloadsThe cleanest and easiest to roll back; it needs temporary capacity and declarative deployments
Change /etc/cni/net.d/New pods are born with Cilium; old ones stay on the previous CNI until they restartDuring the transition two networks coexist that may not see each other
Node-by-node restartYou change the configuration and restart each nodeUntil you finish, there are islands of migrated and non-migrated nodes
Hybrid migrationCilium runs with its own PodCIDR and overlay alongside the previous CNI; you drain and migrate node by nodeThe most controlled; follow the official migration guide

Metrics and dashboards

In chapter 15 you looked at application traffic. Now it's time to watch Cilium itself. Metrics are off by default; turn them on in your values:

# values-cilium.yaml (excerpt)
prometheus:
  enabled: true              # agent · port 9962
  serviceMonitor:
    enabled: true            # if you use Prometheus Operator
operator:
  prometheus:
    enabled: true            # operator · port 9963
hubble:
  metrics:
    enabled: [dns, drop, tcp, flow, port-distribution, icmp, httpV2]   # · port 9965

What to watch, at a minimum:

SignalWhy it matters
Agents and operator readyWithout the agent there are no new pods and no map updates
Drops by reason (hubble_drop_total)A spike in "Policy denied" or "Stale" gives away a change or a problem
eBPF map and IPAM usageA full map or pool prevents new connections or pods
Endpoint regeneration timeIf it grows, policies take longer to apply
BGP sessions and Cluster Mesh statusIf you use them, they're your connectivity to the outside world and to other clusters

Cilium publishes Grafana dashboards for the agent, the operator and Hubble; import them as a starting point and expose Grafana through Ingress or Gateway API, not with a port-forward.

Day-to-day troubleshooting

An order that works when something goes wrong:

# 1 · Overall health of agents, operator and optional components
cilium status

# 2 · Automated connectivity tests (more than a hundred); or only the ones you care about
cilium connectivity test
cilium connectivity test --test '^to-fqdns'

# 3 · Node-to-node connectivity as seen by each agent
kubectl -n kube-system exec ds/cilium -- cilium-health status

# 4 · What's really happening: flows and drops
hubble observe -P -t drop --last 50

# 5 · Errors in agents and operator
kubectl -n kube-system logs ds/cilium --since=1h | grep -iE "level=(error|warn)"
kubectl -n kube-system logs deploy/cilium-operator --since=1h | grep -iE "level=(error|warn)"

# 6 · Full bundle to ask the community for help
cilium sysdump --node-list kind-worker2 --logs-since-time 2h
  • cilium-health status shows whether each node can reach the others. If there are unreachable nodes, the problem is usually in the physical network.
  • Logs are usually clear: for example, if you turn on Gateway API without installing its CRDs, the operator tells you.
  • Before sharing a sysdump, open it and review it: it doesn't include your applications' secrets, but it does include metadata for every pod and node, and it may include Hubble flows with headers.

Fine-tuning: layer 2 and BGP

Layer 2 announcements

Two operational questions: how long it takes a new node to take over, and how the client finds out.

Helm valueDefaultWhat it controls
l2announcements.leaseDuration15sHow long without a renewal before another leader is elected
l2announcements.leaseRenewDeadline5sMaximum time for a renewal attempt
l2announcements.leaseRetryPeriod2sHow often the leader tries to renew

Lower values give faster failovers, but they put load on the API server; tune them to your network's real latency. On the client side, everything depends on its ARP cache and on whether it accepts gratuitous ARP.

BGP

  • Announce services, not pods: service IPs are stable; pod IPs change all the time.
  • Unique ranges: if several clusters announce over BGP, their ranges can't overlap.
  • Graceful restart, with judgment: it avoids withdrawing routes during an upgrade, but on a real failure the router will keep sending traffic to the dead node until the timer expires. Choose based on what hurts you more.

Journey's end

You've gone through the whole book: from why Cilium exists to how to run it in production. You covered eBPF, IPAM, the datapath, services, Gateway API, performance, multi-cluster, ingress and egress, policies from layer 3 to layer 7, encryption and observability.

The authors' last piece of advice is ours too: understand the tools you use and their limits. With that, you can design architectures that tolerate failure, plan upgrades with confidence and choose only the features your team is able to operate.

Your next step

Build a lab cluster with the files from this topic and repeat the exercises without looking. Then validate what you've learned with Isovalent's free labs or with the Linux Foundation's CCA (Cilium Certified Associate) certification.

Challenge

Answer before you open the solution.

1. What is the preflight for before an upgrade?

To pull the new images on every node and validate the configuration before restarting anything, and so shorten the outage window.

2. While an agent restarts, what stops working on its node?

DNS/FQDN policies, BGP (unless you use graceful restart) and new pods. If Envoy restarts too, layer 7, Ingress and Gateway API.

3. Why is it dangerous for GitOps to manage the Cilium of its own cluster?

Because if an upgrade breaks the network, it also breaks the tool that should roll it back.

4. What do you review before sharing a cilium sysdump?

Its contents: it includes metadata for every pod and node and may contain Hubble flows with sensitive headers.

What you take away

  • Helm with GitOps to make changes; the CLI to query and troubleshoot.
  • Move to the latest patch, run the preflight and upgrade one minor version at a time.
  • eBPF survives an agent restart; the DNS proxy, BGP and Envoy don't.
  • Watch Cilium itself: agents, drops, maps, IPAM and regeneration.
  • cilium status, connectivity test, cilium-health, Hubble and sysdump, in that order.

With this chapter you complete topic 04 of the Modern Cloud route.

Official resources

Source and credits. This chapter summarizes and paraphrases the official book Cilium: Up and Running by Nico Vibert, Filip Nikolic and James Laverack (O'Reilly Media, 2026). The summary was produced with AI and reviewed, verified and approved by Jesús Espinoza. The diagrams and code examples are original work by The House of Routing and were checked against the official Cilium documentation. Cilium: Up and Running, the cover image, and related trade dress are trademarks of O'Reilly Media, Inc. This content is not affiliated with or endorsed by O'Reilly Media or Isovalent.

Navigate