Cilium Certified Associate cheat sheet
Cilium Certified Associate · Keep the key ideas within reach.
Cilium Architecture and Fundamentals
Cilium runs as a privileged DaemonSet (cilium-agent) on every node plus a central cilium-operator Deployment; each agent programs eBPF into the kernel and the operator handles cluster-wide tasks like IPAM allocation and garbage collection.
The datapath is eBPF programs attached to TC ingress/egress hooks on network interfaces and to socket-level hooks (sock_ops, sk_msg); iptables is bypassed for pod traffic when kube-proxy replacement is enabled.
The agent exposes a local API on a Unix socket and a health endpoint;
cilium-dbg(formerlycilium) talks to the local agent, whileciliumCLI with a kubeconfig talks to the Kubernetes API.Key CRDs: CiliumNetworkPolicy, CiliumClusterwideNetworkPolicy, CiliumEndpoint, CiliumEndpointSlice, CiliumNode, CiliumIdentity, CiliumBGPPeeringPolicy, CiliumLoadBalancerIPPool, CiliumGatewayClassConfig, CiliumLocalRedirectPolicy.
Identity-based security: each unique set of pod labels is assigned a numeric security identity; policy is evaluated against identities, not IP addresses, so it survives scaling and IP churn.
The kvstore (etcd) is optional for identity and IP allocation; when omitted, the operator uses Kubernetes CRDs (CiliumIdentity, CiliumNode) for the same state.
Hubble is the observability layer: hubble-server embedded in the agent streams flow events over gRPC; hubble-relay aggregates across nodes; hubble-ui is a web frontend.
eBPF programs are compiled and loaded at agent start; kernel requirements are typically >= 4.19 (5.4+ recommended for full feature set, 5.10+ for advanced features like BGPv2 or BIG TCP).
CiliumEndpointSlice (CES) is enabled by default in recent versions to reduce the load of per-endpoint CiliumEndpoint objects on the API server and agents.
Cilium Installation and Configuration
Primary install path is Helm:
helm install cilium cilium/cilium --namespace kube-system --set ...; the official values.yaml documents every option andhelm show values cilium/ciliumprints it.cilium install(Cilium CLI) is a wrapper that renders Helm with auto-detected settings;cilium status --waitandcilium connectivity testvalidate the deployment.kubeProxyReplacement=true removes kube-proxy; kube-proxy must then be uninstalled or never installed, and the API server host/port must be reachable (KUBERNETES_SERVICE_HOST/PORT or explicit k8sServiceHost/k8sServicePort).
IPAM mode is set with
ipam.mode: cluster-pool (default, per-node CIDRs from CiliumNode), kubernetes (host-scope or multi-pool), eni (AWS), azure, alibabacloud, or delegated-plugin (e.g., to a CNI plugin).Tunneling is selected with
routingMode(tunnel/native) andtunnelProtocol(vxlan or geneve); native routing requires the pod CIDR to be routable on the underlying network or BGP to advertise it.bpf.masquerade=trueenables eBPF-based masquerading instead of iptables; it requires kube-proxy replacement or at least BPF NodePort, and it is incompatible with some iptables-based setups.operator.replicasdefaults to 2;hubble.enabled=true,hubble.relay.enabled=true,hubble.ui.enabled=trueenable observability components.cilium upgrade/helm upgradeperforms rolling upgrades;cilium-dbg statusandcilium-dbg endpoint listverify health, andcilium-dbg bpf ...inspects maps.Configuration can be supplied via Helm values, the CiliumConfig CRD (when using the Cilium Helm chart's configmap mode), or agent ConfigMap keys under
data; precedence is agent flags > ConfigMap > defaults.
Kubernetes Networking with Cilium (CNI, IPAM, Routing)
Cilium installs a CNI configuration (default /etc/cni/net.d/05-cilium.conflist) and a chained binary; pod sandbox creation calls the CNI plugin, which asks the agent for an IP and programs the endpoint.
cluster-pool IPAM: the operator carves per-node PodCIDRs from
ipam.operator.clusterPoolIPv4PodCIDRListand records them in CiliumNode; the agent allocates individual IPs from its own CIDR.kubernetes IPAM uses the node's
spec.podCIDR(host-scope) or CiliumPodIPPool objects (multi-pool) instead of Cilium-managed CIDRs.Tunnel mode (VXLAN default, port 8472; Geneve port 6081) encapsulates pod-to-pod traffic between nodes; native routing sends packets directly and requires routable pod CIDRs.
Direct routing device (
directRoutingDevice) andautoDirectNodeRoutes=trueadd per-node routes for the remote pod CIDRs when native routing is used.enableIPv4Masquerade/enableIPv6Masqueradecontrol SNAT for traffic leaving the cluster;egressMasqueradeInterfacesrestricts which interfaces masquerade.Dual-stack requires
ipv4.enabled=trueandipv6.enabled=trueplus an IPv6 pod CIDR; the cluster must also be dual-stack at the Kubernetes level.cilium-dbg status --all-addressesandcilium-dbg ip listshow allocated IPs;cilium-dbg node listshows per-node health and the tunnel/routing mode in use.Bandwidth manager (
bandwidthManager.enabled) uses eBPF EDT to enforce podkubernetes.io/ingress/egress-bandwidthannotations without tc qdiscs.
Network Policy and Security
CiliumNetworkPolicy (namespaced) and CiliumClusterwideNetworkPolicy (cluster-scoped) extend Kubernetes NetworkPolicy with L7 rules, DNS-based egress rules, and identity selectors.
endpointSelectorpicks the pods the policy applies to;ingress/egressrules matchfromEndpoints/toEndpoints(label selectors),toFQDNs,toCIDR,toEntities(world, cluster, host, kube-apiserver, remote-node, all).L7 rules use
http,kafka,dns, orl7fields and require a Layer 7 proxy (Envoy) to be embedded; they are evaluated per-request rather than per-connection.Policy enforcement modes per endpoint:
default(allow all),always(deny by default),never(audit only),disabled; set viapolicyEnforcementModeor the endpoint's--policyannotation.enableDefaultDenyin the policy spec controls whether the policy switches the selected endpoints to default-deny for the covered direction; policies are additive (union of allows).DNS-based egress:
toFQDNswithmatchNameormatchPattern; requiresdnsproxy/DNS interception enabled and works withtoEndpointsfor the DNS server.Cilium enforces policy in eBPF at the endpoint's TC hooks; L3/L4 policy is enforced without a proxy, only L7 policy traffic is redirected to Envoy.
cilium-dbg policy getshows the resolved policy for an endpoint;cilium-dbg monitorshows verdicts (ALLOWED/DENIED) with the policy that matched.Encryption: WireGuard (
encryption.enabled=true,encryption.type=wireguard) or IPsec (encryption.type=ipsec) protects node-to-node traffic; both can coexist with policy.
Observability and Troubleshooting
cilium status --waitreports agent, operator, Hubble, and kube-proxy replacement health;cilium-dbg status --verboseadds controller and map details on a node.cilium-dbg monitorstreams datapath events; flags like-t dropshow only drops,-t traceshows policy trace,--from/--tofilter by endpoint or identity.Hubble flow fields: verdict (FORWARDED/DROPPED/ERROR), source/destination identity and labels, L4 ports, L7 protocol and latency, node name, and the drop reason.
hubble observe --verdict DROPPED --namespace Xfilters dropped flows;hubble observe --followtails live;hubble statusshows relay connectivity.Drop reasons are named (e.g., Policy denied, CT: no matching entry, Invalid source identity);
cilium-dbg monitor -t dropprints them with the endpoint and direction.Endpoint state machine:
cilium-dbg endpoint listshowsready,waiting-for-identity,not-ready, ordisconnected;cilium-dbg endpoint get <id>shows the policy revision and identity.cilium-dbg bpf ct listandcilium-dbg bpf nat listinspect conntrack and NAT maps;cilium-dbg bpf policy get <id>shows the policy map for an endpoint.cilium connectivity testdeploys a test namespace and exercises pod-to-pod, pod-to-service, DNS, and policy scenarios; it is the fastest end-to-end validation.Common failure sources: MTU mismatch (tunnel overhead 50 bytes for VXLAN), kube-proxy still running with replacement enabled, missing
toEntities: kube-apiserverpolicy for the API server, and CNI config conflicts.
Service Mesh, Load Balancing, and Gateway API
Cilium Service Mesh uses Envoy embedded in the agent as a per-node proxy; it can be enabled per-pod via annotations (
ingress.cilium.io/...) or cluster-wide, avoiding a sidecar per pod.CiliumEnvoyConfigandCiliumClusterwideEnvoyConfigCRDs inject Envoy listeners and routes; they are the building blocks for custom L7 handling and Ingress/Gateway.kube-proxy replacement implements ClusterIP, NodePort, LoadBalancer, and ExternalIPs with eBPF;
kubeProxyReplacement=trueandbpf.masqueradeare the key settings.NodePort with
nodePort.mode=dsr(Direct Server Return) orhybridreduces the return path;nodePort.acceleration=nativeuses XDP for NodePort handling.Maglev (
loadBalancer.algorithm=maglev) provides consistent hashing for backend selection; default is random.Cilium Gateway API: install Gateway API CRDs, enable
gatewayAPI.enabled=true, create a GatewayClass referencingio.cilium/gateway-controller, then a Gateway and HTTPRoute.Gateway API supports HTTPRoute, GRPCRoute, TLSRoute, and TCPRoute depending on the Cilium version and installed CRDs; the Gateway listener defines protocol and port.
Ingress support is via
ingressController.enabled=true; the IngressClass name isciliumand it uses the same Envoy data plane.CiliumBGPPeeringPolicyandCiliumLoadBalancerIPPooladvertise LoadBalancer IPs via BGP;bpgcontrol plane requiresbgpControlPlane.enabled=true(v1.16+).
Cluster Mesh and Multi-Cluster Networking
Cluster Mesh connects clusters by sharing identities and endpoints across a common kvstore or via the clustermesh-apiserver; each cluster keeps its own control plane.
Requirements: unique cluster names, non-overlapping pod CIDRs and node IPs, and connectivity between clustermesh-apiserver (port 2379) and agents on port 4240.
Enable with
cluster.name=<name>,cluster.id=<n>, andclustermesh.useAPIServer=true; the clustermesh-apiserver runs in each cluster and is exposed via a Service.cilium clustermesh connect --context <ctx1> --destination-context <ctx2>wires the clusters;cilium clustermesh statusverifies connectivity.Global services: annotate a Service with
service.cilium.io/global: "true"to load-balance across clusters;service.cilium.io/shared: "false"keeps backends local.service.cilium.io/affinity: local|remote|nonecontrols backend preference;service.cilium.io/affinity.timeoutsets how long local preference is kept.CiliumNetworkPolicy
fromEndpointsmatches remote pods by labels; remote identities are prefixed with the cluster name in the identity store, andio.cilium.k8s.policy.clusterselects the cluster.Cross-cluster traffic uses the same eBPF datapath; the tunnel or native routing must be able to reach the remote pod CIDR (typically via the clustermesh-apiserver's advertised routes or a shared network).
cilium-dbg troubleshoot clustermeshandcilium-dbg troubleshoot kvstorediagnose connectivity and identity sync problems between clusters.