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:
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:
- Read the upgrade notes for the target version.
- First move to the latest patch of your current minor version.
- Run the preflight: it pulls the new images on every node and validates the configuration before touching anything.
- 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 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-envoyDaemonSet. 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:
| Strategy | How it works | Keep in mind |
|---|---|---|
| New cluster | You create a cluster with Cilium and redeploy the workloads | The 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 restart | During the transition two networks coexist that may not see each other |
| Node-by-node restart | You change the configuration and restart each node | Until you finish, there are islands of migrated and non-migrated nodes |
| Hybrid migration | Cilium runs with its own PodCIDR and overlay alongside the previous CNI; you drain and migrate node by node | The 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:
| Signal | Why it matters |
|---|---|
| Agents and operator ready | Without 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 usage | A full map or pool prevents new connections or pods |
| Endpoint regeneration time | If it grows, policies take longer to apply |
| BGP sessions and Cluster Mesh status | If 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 statusshows 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 value | Default | What it controls |
|---|---|---|
l2announcements.leaseDuration | 15s | How long without a renewal before another leader is elected |
l2announcements.leaseRenewDeadline | 5s | Maximum time for a renewal attempt |
l2announcements.leaseRetryPeriod | 2s | How 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.
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 andsysdump, in that order.
With this chapter you complete topic 04 of the Modern Cloud route.
Official resources
- Upgrade Guidedocs.cilium.io
- Migrating a cluster to Ciliumdocs.cilium.io
- Troubleshootingdocs.cilium.io
- Running Prometheus & Grafanadocs.cilium.io
- Cilium Certified Associate (CCA)linuxfoundation.org
- Cilium: Up and Running (book)isovalent.com
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.