Skip to content

The Role of Cilium in Kubernetes: CCA practice questions

In a Kubernetes cluster Cilium takes on several jobs that are otherwise spread across separate tools. First it is the CNI plugin: when a pod is scheduled, Kubernetes calls cilium-cni on the node, the pod gets an address from the node's prefix, and the agent attaches eBPF programs to its network device.

By Ibrahim Yesilay · Published · Updated

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

What The Role of Cilium in Kubernetes covers in CCA

In a Kubernetes cluster Cilium takes on several jobs that are otherwise spread across separate tools. First it is the CNI plugin: when a pod is scheduled, Kubernetes calls cilium-cni on the node, the pod gets an address from the node's prefix, and the agent attaches eBPF programs to its network device. Without any network policy, every pod can reach every other pod, which matches the Kubernetes networking model. Traffic from pods to destinations outside the cluster is masqueraded to the node address as it leaves the node by default.

Second, Cilium enforces policy. It implements the standard NetworkPolicy resource for Layer 3 and 4 isolation, and adds CiliumNetworkPolicy for Layer 7 rules such as HTTP methods and paths, CIDR-based egress and DNS names. Enforcement is tied to identities derived from pod labels rather than to pod IP addresses, which keeps rules stable while pods come and go.

Third, Cilium can take over Service load balancing. kube-proxy watches Services and endpoints and writes iptables rules; Cilium watches the same objects but writes eBPF map entries on each node. With kubeProxyReplacement=true it handles ClusterIP, NodePort, LoadBalancer and externalIPs Services and also hostPort, so the portmap plugin is not needed. The replacement depends on socket-LB: for east-west traffic the backend is chosen when the application calls connect(), so the socket is attached to a backend address and no per-packet translation is required. Maglev consistent hashing, selected with loadBalancer.algorithm=maglev, applies only to north-south traffic for that reason.

Running without kube-proxy has one installation detail that often surprises people. A cluster created with kubeadm init --skip-phases=addon/kube-proxy has nothing that serves the ClusterIP of the API server Service when Cilium starts, so k8sServiceHost and k8sServicePort must point the agent at the real API server address.

Cilium can also sit next to another plugin. In CNI chaining mode the other plugin, for example the AWS VPC CNI, keeps responsibility for connectivity and address management, and Cilium attaches its programs to the devices that plugin created to add visibility and policy.

Finally, installation order matters. Pods that were already running before Cilium was deployed are not managed by it. Either nodes are created with the node.cilium.io/agent-not-ready taint so that workloads wait for the agent, or every pod that is not in host-networking mode is restarted after installation so it receives Cilium networking and its policies apply. On top of these core roles, Hubble adds flow visibility, Cluster Mesh joins several clusters, and the service mesh features add Ingress, Gateway API and encryption.

Key points

  • Without any policy object, all pods can reach each other.
  • kubeProxyReplacement=true covers ClusterIP, NodePort, LoadBalancer, externalIPs and hostPort.
  • A kube-proxy-free cluster needs k8sServiceHost and k8sServicePort set for the agent.
  • In CNI chaining, the other plugin keeps IPAM and connectivity; Cilium adds eBPF policy and visibility.
  • Pods started before Cilium must be restarted unless nodes carried the agent-not-ready taint.

Three sample questions

12 CCA questions on The Role of Cilium in Kubernetes, 12 with explanations. How practice works

Question 1

Which setting would you use in Cilium's configuration to replace kube-proxy functionality completely?
  1. A.--set kubeProxyReplacement=true
  2. B.--set enableKubeProxyReplacement=strict
  3. C.--set kubeProxy.enabled=false
  4. D.--set kubeProxyReplacement=disabled

Correct answer: A

The kube-proxy-free guide installs Cilium with the Helm value kubeProxyReplacement=true (together with k8sServiceHost/k8sServicePort, because there is no kube-proxy to provide the API server Service). Why the other options are wrong. enableKubeProxyReplacement: not a Helm value. kubeProxy.enabled=false: not a Cilium Helm value; kube-proxy itself is removed with kubeadm --skip-phases=addon/kube-proxy or by deleting its DaemonSet. kubeProxyReplacement=disabled: the old partial/strict/disabled style values were replaced by true/false.

Sources: Cilium docs: Kubernetes Without kube-proxy, Cilium docs: Installation using Helm

Question 2

Which component of Cilium performs load balancing of Kubernetes services?
  1. A.Hubble
  2. B.Cilium Operator
  3. C.eBPF programs deployed by the Cilium agent
  4. D.kube-proxy

Correct answer: C

In Cilium, service load balancing is performed by eBPF programs that are compiled and deployed by the Cilium agent. These programs efficiently implement the service selection logic directly in the kernel, eliminating the need for kube-proxy.

Question 3

Which CNI chaining mode would you use to run Cilium with AWS VPC CNI?
  1. A.generic-veth
  2. B.aws-cni
  3. C.amazon-vpc
  4. D.flannel

Correct answer: B

The correct CNI chaining mode to run Cilium with AWS VPC CNI is aws-cni. This configuration allows Cilium to work alongside the AWS VPC CNI, with AWS VPC CNI handling IP allocation and basic connectivity while Cilium provides advanced networking features.

Practice this topic

Focus mode keeps every question on The Role of Cilium in Kubernetes 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

Do I have to remove kube-proxy to use Cilium?

No. Cilium works as a CNI alongside kube-proxy; removing it and setting kubeProxyReplacement=true is an option that moves Service handling into eBPF.