Container Networking: KCSA practice questions
Container networking explains how traffic reaches pods, and it is the foundation that network security controls later restrict. The Kubernetes network model gives each pod its own unique cluster-wide IP address.
By Ibrahim Yesilay · Published · Updated
Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.
What Container Networking covers in KCSA
Container networking explains how traffic reaches pods, and it is the foundation that network security controls later restrict. The Kubernetes network model gives each pod its own unique cluster-wide IP address. Containers in the same pod share a network namespace and talk over localhost, and all pods can reach all other pods, on the same node or on different nodes, directly and without NAT. Kubernetes defines this model but does not implement it: on Linux the container runtime uses the Container Network Interface to call a pod network implementation, usually called a CNI plugin.
That default openness is the security point. Unless something restricts it, any compromised pod can open connections to every other pod. NetworkPolicy is the built-in API for controlling traffic between pods or between pods and the outside world at layer 3 or 4, but it is enforced by the network implementation; if the plugin does not support it, the API still exists and the policies simply have no effect.
Pods are ephemeral, so their addresses are not a stable target. A Service gives a set of pods, usually chosen by a label selector, a stable way to be reached, and the control plane keeps the Service's EndpointSlices in step as matching pods come and go. There are four Service types. ClusterIP, the default when no type is given, exposes the Service on a cluster-internal IP that is reachable only from inside the cluster. NodePort also allocates a cluster IP and additionally opens a static port on every node, taken from the range set by --service-node-port-range, 30000-32767 by default. LoadBalancer exposes the Service through an external load balancer that you or a cloud provider integration must supply. ExternalName maps the Service to an external hostname by returning a DNS CNAME record, with no proxying at all. A headless Service, created by setting clusterIP to None, gets no cluster IP and no load balancing from the platform.
kubectl expose builds a Service from an existing pod, Deployment, ReplicaSet, replication controller or Service, reusing that resource's selector; its --type flag defaults to ClusterIP, so kubectl expose deployment nginx --port=80 --target-port=8000 creates an internal Service. For debugging, kubectl port-forward <pod> 28015:27017 forwards a local port to a port in the pod. The documentation notes that authorization for it is enforced by the API server and that port forwarding can give direct network access to a workload, bypassing network-level controls, so it is a permission worth restricting.
HTTP routing from outside is the job of Ingress. An Ingress maps hostnames and URL paths to backend Services and can terminate TLS, but it does not expose arbitrary ports or protocols, and creating the resource alone has no effect: an Ingress controller must be running to implement it, with ingressClassName selecting which one. The Kubernetes project now recommends Gateway API over Ingress; the Ingress API is frozen but still generally available and not scheduled for removal.
Key points
- Every pod gets its own cluster-wide IP and can reach every other pod without NAT unless policy restricts it.
- ClusterIP is the default Service type; NodePort ports come from 30000-32767 by default.
- ExternalName returns a DNS CNAME and does no proxying.
- An Ingress resource does nothing without a running Ingress controller.
- NetworkPolicy has no effect if the network plugin does not implement it.
Three sample questions
9 KCSA questions on Container Networking, 9 with explanations. How practice works
Question 1
- A.ClusterIP
- B.NodePort
- C.LoadBalancer
- D.ExternalName
- E.Ingress
Correct answer: A
Question 2
- A.ClusterIP
- B.NodePort
- C.LoadBalancer
- D.ExternalName
- E.InternalPort
Correct answer: E
Sources: Kubernetes Official Documentation - Services, Kubernetes API Reference - Service Spec
Question 3
- A.It defines internal networking rules between pods
- B.It manages external HTTP and HTTPS access to services
- C.It is used for storing configuration data
- D.It schedules pods to nodes
- E.It provides persistent storage to pods
Correct answer: B
Sources: Kubernetes Official Documentation - Ingress, Kubernetes Networking Concepts
Practice this topic
Focus mode keeps every question on Container Networking until you leave it. 10 free guest answers, then a free account; no credit card.
Or open KCSA practice across all topics.
Sources
The explanation above was checked against these official documents.
- Kubernetes documentation: Services, Load Balancing, and Networking (checked 2026-10-23)
- Kubernetes documentation: Service (checked 2026-10-23)
- Kubernetes documentation: Ingress (checked 2026-10-23)
- Kubernetes documentation: Use Port Forwarding to Access Applications in a Cluster (checked 2026-10-23)