CKNE · CHEAT SHEET
Certified Kubernetes Network Engineer (CKNE)
Key concepts grouped by official exam weight.
Download as PDF (free, no sign-up)1. Core Infrastructure and CNI
15–15%Installing and Configuring CNI Plugins
- The container runtime looks up CNI executables in /opt/cni/bin and configuration in /etc/cni/net.d; on ADD it runs the plugins of a list in order and on DEL in reverse order. Without a network plugin the node stays NotReady and CoreDNS Pending. Cilium is installed with helm install in kube-system, checked with cilium status, and Pods that predate it must be restarted.
Managing IPAM and Pod CIDR Allocation
- kube-controller-manager gives each node a spec.podCIDR carved from --cluster-cidr when --allocate-node-cidrs is on, sized by --node-cidr-mask-size. host-local allocates from its ranges and keeps state in /var/lib/cni/networks. Cilium cluster-pool uses CiliumNode and is expanded by appending CIDRs to the list; Service ClusterIPs come from ServiceCIDR objects, not from the Pod range.
Using Linux Tools (iptables, ip, tcpdump) for Packet-level Issues
- ip route get shows the route the kernel would use, ip neigh the neighbour resolution state, ip -d link the veth or VXLAN details, and nsenter -t PID -n enters a container's network namespace. iptables-save reveals the KUBE-SERVICES, KUBE-SVC and KUBE-SEP chains; in nftables mode, nft list table ip kube-proxy. tcpdump -i any -n with host and port filters shows whether SYNs arrive and get a reply.
Troubleshooting Pod Connectivity (DNS, pod-to-pod)
- To debug DNS from a Pod, check /etc/resolv.conf (nameserver of the kube-dns Service, search domains, ndots), check the CoreDNS Pods (label k8s-app=kube-dns) and their EndpointSlices, and remember that a deny-all egress policy also blocks DNS. Pods talk across nodes without NAT; kubectl debug adds ephemeral containers or opens a node session to capture traffic.
Configuring Multi-interface Pods
- Multus is a CNI meta-plugin: it keeps the cluster default network on eth0 and adds extra interfaces defined in NetworkAttachmentDefinition objects (k8s.cni.cncf.io/v1) holding a CNI config such as macvlan, ipvlan or host-device. A Pod requests them with the k8s.v1.cni.cncf.io/networks annotation (namespace/name@interface or JSON) and the result is read from k8s.v1.cni.cncf.io/network-status, with interfaces net1, net2...
2. Service Networking and DNS
25–25%Configuring L4 Services
- A Service exposes Pods by selector with port and targetPort (also named): ClusterIP is the default type, NodePort opens the same port on every node, LoadBalancer needs an external implementation, ExternalName returns a CNAME and clusterIP: None makes a headless Service. externalTrafficPolicy Local keeps the client source IP, internalTrafficPolicy Local requires a node-local endpoint and PreferSameZone prefers the client zone.
Understanding kube-proxy and CNI Alternatives
- kube-proxy programs on every node the rules that steer ClusterIP traffic to endpoints, in iptables, nftables or the deprecated ipvs mode; the mode is set with the mode field of the KubeProxyConfiguration, kept by kubeadm in the kube-proxy ConfigMap. Cilium can replace kube-proxy with kubeProxyReplacement=true, k8sServiceHost and k8sServicePort, after removing the DaemonSet, the ConfigMap and the KUBE rules from the nodes.
Customizing coreDNS for Services
- CoreDNS serves the kube-dns Service and is configured through the Corefile in the coredns ConfigMap of kube-system: the kubernetes plugin answers cluster names, forward sends the rest to upstream resolvers and a separate server block creates a stub domain. hosts adds static entries (with fallthrough so the chain continues), rewrite aliases a name to a Service and reload applies changes.
Troubleshooting Service Network Traffic
- Debug a Service layer by layer: it exists and resolves in DNS, its selector matches the Pod labels (kubectl get endpointslices -l kubernetes.io/service-name=web), the targetPort and protocol match the container, and kube-proxy has programmed the KUBE-SVC and KUBE-SEP rules on every node. Local traffic policies drop traffic on nodes without local endpoints.
Configuring Pod Endpoint Availability
- The readiness probe and readinessGates decide whether a Pod's address is ready in the EndpointSlice; liveness and startup probes restart or delay, they do not withdraw traffic. When a Pod is deleted its endpoint becomes terminating with ready false, and a preStop hook within terminationGracePeriodSeconds drains connections. PodDisruptionBudgets limit voluntary evictions, and maxSurge, maxUnavailable and minReadySeconds protect rollouts.
Managing Traffic with the Gateway API (Gateway, HTTPRoutes)
- A Gateway defines listeners (protocol, port, hostname) and uses allowedRoutes to decide which namespaces may attach routes; an HTTPRoute binds through parentRefs and routes by host, path, headers, query params and method to backendRefs with proportional weights. Filters redirect, rewrite, modify headers or mirror traffic, and the Accepted and ResolvedRefs conditions explain why a route does not work.
3. Advanced Traffic Management
20–20%Optimizing LLM Traffic
- With the Gateway API Inference Extension, an InferencePool groups model server Pods (selector and targetPorts) and replaces the Service as the HTTPRoute backendRef. Its endpointPickerRef points to an Endpoint Picker that chooses the Pod from metrics such as request queue length and KV-cache usage; failureMode decides whether, when it fails, the request is still forwarded (FailOpen) or dropped (FailClose).
Implementing Routing to Expose Networks
- With Cilium, the BGP Control Plane (CiliumBGPClusterConfig, CiliumBGPPeerConfig and CiliumBGPAdvertisement) advertises each node's Pod CIDR and Service VIPs to routers, while LB IPAM assigns LoadBalancer IPs from a CiliumLoadBalancerIPPool. VXLAN or Geneve encapsulation needs no Pod CIDR awareness in the network; native routing does. externalIPs is deprecated and hostPort ties Pods to nodes.
Configuring Egress Gateways for Cluster Exit Traffic
- With Cilium, a cluster-scoped CiliumEgressGatewayPolicy (needing bpf.masquerade and kubeProxyReplacement) sends selected Pods' traffic to destinationCIDRs, minus excludedCIDRs, through a gateway node that SNATs it to egressIP or an interface address. In Istio, istio-egressgateway works with a ServiceEntry, Gateway, VirtualService and DestinationRule, and REGISTRY_ONLY blocks unregistered hosts.
Implementing Cross Cluster Service Discovery and Load Balancing
- The Multi-Cluster Services API exports a Service with a ServiceExport of the same name; the controller creates the ServiceImport and EndpointSlices, and <svc>.<ns>.svc.clusterset.local reaches backends across the ClusterSet. In Cilium Cluster Mesh each cluster needs a unique name and ID and non-overlapping Pod CIDRs; Global Services use service.cilium.io/global, shared and affinity.
4. Network Security and Policy
25–25%Securing Traffic with Network Policies
- A NetworkPolicy works only if the network plugin enforces it; it isolates the selected Pods per direction and its allow rules add up. podSelector: {} with no rules creates a default deny, and one from element holding both namespaceSelector and podSelector is an AND. For HTTP rules, toFQDNs or cluster-wide scope, Cilium offers CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy.
Implementing Node and Pod Level Encryption
- Cilium transparently encrypts traffic between Pods on different nodes with WireGuard (cilium_wg0 interface, per-node keys published in CiliumNode) or IPsec (cilium-ipsec-keys Secret in Cilium's namespace, rotated by incrementing the key ID). Istio adds mutual TLS between workloads, through sidecars or through ztunnel and HBONE in ambient mode, which also authenticates identities.
Managing TLS Certificates for Gateway API
- In Gateway API, an HTTPS or TLS listener in Terminate mode references a kubernetes.io/tls Secret in tls.certificateRefs; a Secret in another namespace needs a ReferenceGrant there, and Passthrough is routed with TLSRoute. BackendTLSPolicy validates TLS towards the Service. cert-manager, with its Gateway API support enabled, creates Certificates from the Gateway annotations.
Implementing Pod-level Authentication and Authorization
- In Istio, PeerAuthentication sets the mTLS mode (STRICT, PERMISSIVE, DISABLE) for the mesh, a namespace or a workload, and AuthorizationPolicy allows or denies by identity (cluster.local/ns/<ns>/sa/<sa>), method or path; DENY wins over ALLOW. RequestAuthentication validates JWTs and needs a policy with requestPrincipals. In ambient mode ztunnel enforces L4 and L7 rules require a waypoint.
5. Observability
15–15%Analyzing Network Health Using Metrics
- Counters such as istio_requests_total are read with rate() or increase(), applying rate() before sum, and latency with histogram_quantile() over the _bucket series keeping le. The reporter, response_code and source_workload labels locate a fault. In Cilium, Hubble metrics (drop, flow, dns, httpV2) are enabled separately with hubble.metrics.enabled; CoreDNS exposes coredns_* through its prometheus plugin.
Troubleshooting End-to-End Network Performance with Tracing
- In Istio the proxies report spans on their own, but the application must forward traceparent, tracestate and x-request-id so that every hop joins one trace. The provider is defined in meshConfig.extensionProviders (for example opentelemetry towards Jaeger or an OpenTelemetry Collector) and enabled with a Telemetry resource, which also sets randomSamplingPercentage per mesh, namespace or workload.
Auditing Traffic with Logs
- With Cilium, hubble observe filters flow logs by namespace, Pod, verdict (DROPPED) or protocol, and the Hubble exporter writes them to files with filter lists and field masks. In Istio, Envoy access logs are enabled with Telemetry or meshConfig.accessLogFile and read with kubectl logs on the istio-proxy container; CoreDNS logs queries with the log plugin, and audit logs only record API requests.