Home › Certifications › CKA › Services and Networking
60 multiple-choice questions and 27 flashcards on Services and Networking, about 20% of the CKA bank. Every one carries a written rationale.
Services and Networking is one of 6 chapters in CoStudy's CKA — Certified Kubernetes Administrator bank, and it holds 60 of the bank's 300 multiple-choice questions — roughly 20% of the total. That proportion is not arbitrary: chapters follow the certifying body's published exam outline, and the number of questions in each is set by that domain's published weight, so the share of your practice time this chapter takes matches the share of the real exam it accounts for.
Studying by chapter is worth doing once you have a diagnostic score. A single overall percentage tells you whether you are close; it does not tell you which domain is dragging. Working a weak chapter in isolation, and re-testing it in isolation, is the fastest way to move a score that has stalled — and it is why the mock exams in CoStudy report by domain rather than as one number.
10 questions drawn from this chapter, with the full rationale shown — the controlling principle behind the right answer, and why each wrong option tempts and fails.
A NetworkPolicy egress rule that lets pods reach CoreDNS requires:
Answer: A — namespaceSelector for kube-system plus k8s-app=kube-dns on port 53
A is right: CoreDNS pods run in kube-system carrying the label k8s-app=kube-dns, so the egress rule selects that namespace and those pods and permits port 53 on UDP and usually TCP as well. Forgetting it is the classic reason a default-deny egress policy breaks every name lookup. B works around the policy by removing the pod from the pod network, which is a serious escalation, not a fix. C confuses privileges with connectivity. D misunderstands the model: policies match pod selectors and ports, not Service addresses.
A cluster has the Gateway API CRDs installed and a Gateway is created, but its status stays unprogrammed with no address. What is the MOST likely reason?
Answer: D — No controller is running for the GatewayClass the Gateway references by name
D) Correct — installing the CRDs only adds the types; a Gateway stays unprogrammed until an implementation whose controllerName matches the referenced GatewayClass reconciles it. A) invents an ordering constraint that does not exist. C) reverses the dependency, as Gateways are addressable before any route attaches. B) describes what many implementations do internally, but the operator does not create that Service and its absence is a symptom, not the cause.
Which Service type exposes a Service on a static port on every node's IP address?
Answer: B — NodePort, which exposes the Service on <NodeIP>:<port> from the 30000-32767 range
B is the answer: a NodePort Service allocates a port in the default 30000-32767 range and every node forwards it to the Service's endpoints. A is internal only. C gives DNS records instead of a virtual IP. D is a DNS alias with no proxying. E tempts because it also handles external traffic, but Ingress is a separate API object, not a Service type. LoadBalancer builds on NodePort by adding a cloud load balancer.
A cluster was built with a /24 pod CIDR and a per-node mask of /24. New nodes join but their pods stay pending with no address available. What is the BEST explanation?
Answer: A — The cluster pod CIDR is too small to be subdivided, so only one node can receive a range
A) Correct — the controller manager carves per-node subnets out of the cluster CIDR, and a /24 cluster range with a /24 node mask yields exactly one allocatable block. B) confuses the two ranges, which are independent. C) invents a manual step; the node controller assigns podCIDR as part of node registration. D) states a version constraint that does not exist for address allocation.
Which statement about NodePort Services is MOST accurate?
Answer: C — The port is allocated from a configurable range and answers on every node in the cluster
C) Correct — the API server allocates from the service-node-port-range (30000-32767 by default) and kube-proxy programs every node to accept on that port, forwarding to a backend wherever it runs. A) is the common misconception that node ports are node-local; that behaviour only appears when externalTrafficPolicy is set to Local. B) is wrong because NodePort is a superset of ClusterIP — the cluster IP is still allocated and still works. D) inverts the relationship: an Ingress controller is often *exposed* via NodePort, not required by it.
Namespace `prod` has a default-deny ingress policy. A second policy is added allowing ingress from pods labelled `role=frontend`. Which statement is MOST accurate?
Answer: B — Policies are additive, so the union of their allow rules determines what is permitted
B) Correct — NetworkPolicy has no deny rules and no precedence order; a connection is allowed if any policy selecting the pod permits it, so adding the second policy opens exactly the frontend path. C) imports last-write-wins semantics from other firewall systems that do not apply here. D) assumes deny rules exist, but the first policy denies only by omitting allowances. A) is unnecessary and would remove the baseline restriction the team wants to keep.
Which resource provides L7 host and path routing to multiple Services?
Answer: B — Ingress, implemented by a controller such as NGINX or Traefik
B is right: Ingress is the routing configuration and an Ingress controller is what implements it, so rules do nothing until a controller and a matching ingressClassName are present. Gateway API now covers the same ground with a richer, role-oriented model and sits alongside Ingress rather than replacing it. A operates at layer 4 and cannot route on host or path. C controls which traffic is permitted, not where it is sent. D is an internal object the endpoints controller maintains for a Service.
An administrator applies a correct Ingress manifest, but its ADDRESS field stays empty and no HTTP routing occurs. What is the MOST likely explanation?
Answer: D — No ingress controller is deployed or none claims the resource's ingressClassName
D) Correct — Ingress is only a declarative record; without a running controller that claims it via IngressClass, nothing programs a data path or reports an address. A) is false, a default backend is optional. B) is a persistent myth: controllers routinely route to ClusterIP Services and many bypass the Service VIP to reach pod endpoints directly. C) confuses pathType semantics with address assignment, which is unrelated to rewriting.
A Service of type ClusterIP:
Answer: C — Is the default type, exposing the Service on an internal virtual IP for in-cluster use
C is the answer: ClusterIP is the default and allocates a stable virtual IP plus a DNS name that only in-cluster clients can reach, with kube-proxy programming iptables or IPVS rules to the current endpoints. A and E describe NodePort, B describes LoadBalancer. D is the problem a Service solves — the virtual IP stays constant while pod IPs churn.
Service of type LoadBalancer is created on a bare-metal kubeadm cluster. What happens?
Answer: D — EXTERNAL-IP stays Pending unless something like MetalLB is installed
D is right: provisioning an external load balancer needs a cloud-controller-manager or a bare-metal controller such as MetalLB or kube-vip; without one the EXTERNAL-IP never leaves Pending. A assumes a cloud that is not there. B credits kube-proxy with address allocation it does not perform. C is wrong because the NodePort is allocated in addition, not as a downgrade.
4 cards from the 27 in this chapter.
If two NetworkPolicies select the same pod, how are they combined?
Additively — the union of their allow rules applies. NetworkPolicies have no deny rules, no ordering and no priority, so adding a policy can only widen what is permitted for an already-selected pod.
What is a headless Service and when do you use one?
A Service with clusterIP: None. No virtual IP or proxying is allocated; DNS returns the pod IPs directly (and per-pod records when backing a StatefulSet). Use it when the client needs to address individual pods, as with databases and peer-to-peer clustering.
Name the three core Gateway API resources and the role each plays.
GatewayClass: cluster-scoped, names the controller implementation • Gateway: an actual listener with protocol, port and TLS, usually owned by the infrastructure team • HTTPRoute: hostname and path rules attached to a Gateway, owned by the application team.
ClusterIP?
Default. Only accessible within cluster.
These are a sample. The full Services and Networking chapter runs 87 items with per-chapter progress tracking, on the web and in the iOS app.