Skip to content

Cilium Architecture: CCA practice questions

Cilium's architecture is easiest to understand as a control plane running in user space and a datapath running in the kernel. The agent on each node receives configuration from Kubernetes, compiles and loads eBPF programs, and fills the eBPF maps those programs read. Once loaded, the programs do the per-packet work: identity lookup, policy, load balancing and forwarding.

By Ibrahim Yesilay · Published · Updated

Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.

What Cilium Architecture covers in CCA

Cilium's architecture is easiest to understand as a control plane running in user space and a datapath running in the kernel. The agent on each node receives configuration from Kubernetes, compiles and loads eBPF programs, and fills the eBPF maps those programs read. Once loaded, the programs do the per-packet work: identity lookup, policy, load balancing and forwarding.

The datapath is built from kernel hooks. XDP runs earliest, in the network driver, and Cilium uses it for a prefilter that drops traffic based on CIDR maps. Traffic control (tc) hooks run after initial stack processing; each pod is connected to the host with a veth pair, and the program on the tc ingress hook of the host-side veth sees every packet that leaves the container. Socket-level programs translate Service addresses when an application connects and speed up redirects between local sockets. Together with the virtual interfaces cilium_host and cilium_net, an optional overlay device and the Envoy proxy, these hooks form logical objects. The Endpoint Policy object maps a packet to an identity and applies L3 and L4 rules, then drops it, delivers it locally, passes it to the Service object or sends it to the L7 Policy object.

Because the programs and maps are pinned in the BPF filesystem at /sys/fs/bpf, they survive a restart of the agent. Forwarding continues while the agent is upgraded, and Cilium mounts the filesystem itself if the host has not. The agent also probes the running kernel and uses newer features when they are present; the current minimum is Linux 5.10, or 4.18 on RHEL 8.10.

State that agents must share, such as identities, is stored in Kubernetes custom resources by default. An etcd key-value store is optional and is described as a scalability optimization for large clusters, because change notifications are more efficient there.

The model of the cluster is expressed in a few objects. An endpoint is the group of containers that share one IP address, normally a pod, with an ID unique on its node. For each managed pod Cilium creates a CiliumEndpoint resource with the same name and namespace that carries its labels, security identity and policy state, so kubectl get ciliumendpoints gives a cluster-wide view. Each agent also creates a cilium-health-<node> endpoint in kube-system for its own health checks, which use ICMP and TCP 4240 between nodes; if a firewall blocks both, Cilium keeps working but reports no health data.

The agent pod runs in the host network namespace and needs CAP_SYS_ADMIN to install eBPF programs system-wide; the standard DaemonSet grants this automatically.

Key points

  • User-space agents program the kernel; eBPF programs then handle each packet without the agent.
  • Pinned eBPF state in /sys/fs/bpf keeps forwarding alive while the agent restarts.
  • CRDs are the default state store; etcd is an optional optimization for scale.
  • One CiliumEndpoint object exists per managed pod and exposes identity and policy state.
  • Endpoint Policy is the datapath object that enforces L3/L4 rules and can hand off to L7.

Three sample questions

11 CCA questions on Cilium Architecture, 11 with explanations. How practice works

Question 1

A new cluster runs Cilium with default settings. Where is state such as security identities stored and propagated between agents?
  1. A.In a dedicated etcd cluster that Cilium requires
  2. B.In a gossip protocol between agents on TCP 4240
  3. C.In Hubble Relay, which syncs agents
  4. D.In Kubernetes custom resources (CRDs)

Correct answer: D

The component overview names Kubernetes CRDs as the default data store for propagating state; a key-value store is optional. Why the other options are wrong. "In a dedicated etcd cluster that Cilium requires": etcd is supported but optional, used as a scalability optimization. "In Hubble Relay, which syncs agents": Hubble Relay aggregates flow data; it does not store Cilium state. "In a gossip protocol between agents on TCP 4240": Port 4240 is used for health checks, not state propagation.

Sources: CNCF CCA curriculum (CCA_Curriculum.pdf), Cilium docs: Component Overview, Cilium docs: System Requirements

Question 2

What is the documented reason to configure Cilium with an etcd key-value store?
  1. A.Network policies cannot be enforced without it
  2. B.Hubble needs it to store the flow history of all nodes
  3. C.IPv6 requires a key-value store
  4. D.To improve scalability of larger clusters

Correct answer: D

All state storage and propagation can be done with CRDs; a key-value store can optionally be used as an optimization because change notifications and storage are more efficient, and the system requirements note that larger clusters perform better with it. Why the other options are wrong. "Network policies cannot be enforced without it": Policy works in the default CRD mode. "Hubble needs it to store the flow history of all nodes": Hubble keeps flows in an in-memory buffer in the agent. "IPv6 requires a key-value store": IPv6 support does not depend on the data store.

Sources: CNCF CCA curriculum (CCA_Curriculum.pdf), Cilium docs: Component Overview, Cilium docs: System Requirements

Question 3

The cilium-agent DaemonSet is being upgraded and an agent pod restarts. What happens to forwarding for existing pods on that node, and why?
  1. A.All pod traffic on the node drops until the agent is back
  2. B.Traffic falls back to kube-proxy iptables rules on the node
  3. C.The cilium-operator forwards traffic for the node meanwhile
  4. D.It continues, because eBPF state persists in the BPF filesystem

Correct answer: D

The system requirements explain that mounting the BPF filesystem (/sys/fs/bpf) lets cilium-agent persist eBPF resources across restarts, so the datapath can continue to operate while the agent is restarted or upgraded. Why the other options are wrong. "All pod traffic on the node drops until the agent is back": The datapath lives in the kernel and keeps running without the agent process. "Traffic falls back to kube-proxy iptables rules on the node": There is no automatic fallback to kube-proxy. "The cilium-operator forwards traffic for the node meanwhile": The operator is never in the forwarding path.

Sources: CNCF CCA curriculum (CCA_Curriculum.pdf), Cilium docs: System Requirements, Cilium docs: Component Overview

Practice this topic

Focus mode keeps every question on Cilium Architecture until you leave it. 10 free guest answers, then a free account; no credit card.

Or open CCA practice across all topics.

Sources

The explanation above was checked against these official documents.

Frequently asked questions

Does Cilium need etcd?

No. The default is Kubernetes CRDs for all state. etcd can be added to improve scalability in larger clusters.