Services and Networking: CKAD practice questions

Services and Networking is 21% of the free CKAD mock (10 of 50 questions). Pick an answer to see right away whether it is correct, with the explanation and the documentation section it comes from.

CK.V · CKAD practice question

A NetworkPolicy in namespace prod has spec.podSelector: { matchLabels: { role: db } }, ingress: [{ from: [{ podSelector: { matchLabels: { role: api } } }], ports: [{ protocol: TCP, port: 5432 }] }], and policyTypes: [Ingress]. Which traffic does it allow?

Choose one answer
Check answer and explanation

Correct answer: Inbound TCP port 5432 to role: db Pods in prod from role: api Pods in prod

Explanation

podSelector in ingress.from without namespaceSelector selects Pods in the policy's own namespace (prod) matching role: api, allowing TCP 5432 into role: db Pods in prod.

Common trap

podSelector in ingress.from without namespaceSelector selects Pods in the policy's own namespace (prod) matching role: api, allowing TCP 5432 into role: db Pods in prod.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

A NodePort Service has type: NodePort, port: 80, targetPort: 8080, and nodePort: 30080. How can an external client reach the Service via a cluster node's IP?

Choose one answer
Check answer and explanation

Correct answer: :30080

Explanation

A NodePort Service listens on the configured nodePort (30080) across cluster nodes and forwards traffic to the Service/targetPort.

Common trap

A NodePort Service listens on the configured nodePort (30080) across cluster nodes and forwards traffic to the Service/targetPort.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

A Pod has spec.dnsPolicy: ClusterFirst. Which DNS server does it query by default for cluster service names?

Choose one answer
Check answer and explanation

Correct answer: The cluster DNS service (such as CoreDNS in kube-system) configured via kubelet's clusterDNS IP

Explanation

ClusterFirst is the default Pod dnsPolicy and sends DNS queries to the cluster DNS service (typically CoreDNS), falling back to upstream nameservers for external domains.

Common trap

ClusterFirst is the default Pod dnsPolicy and sends DNS queries to the cluster DNS service (typically CoreDNS), falling back to upstream nameservers for external domains.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

A Service named api-svc has selector app: api, port: 80, and targetPort: 8080, while the target Deployment's Pods have label app: api-v2 and containerPort: 8080. Why does curl to api-svc fail or time out?

Choose one answer
Check answer and explanation

Correct answer: The Pod label (app: api-v2) does not match the Service selector (app: api), so the Service has no endpoints

Explanation

A Service selects Pods whose labels match all keys/values in spec.selector; because app: api-v2 does not match app: api, no endpoints are populated.

Common trap

A Service selects Pods whose labels match all keys/values in spec.selector; because app: api-v2 does not match app: api, no endpoints are populated.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

A Service named auth-svc exists in namespace iam, and your Pod is in namespace app. Which short DNS name resolves auth-svc from inside namespace app?

Choose one answer
Check answer and explanation

Correct answer: auth-svc.iam

Explanation

From another namespace, . (or the full .svc.cluster.local FQDN) resolves the Service in namespace iam.

Common trap

From another namespace, . (or the full .svc.cluster.local FQDN) resolves the Service in namespace iam.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

A Service named payments-api has port: 80 and targetPort: 8443. What does this mean for traffic hitting payments-api?

Choose one answer
Check answer and explanation

Correct answer: Clients connect to the Service on TCP port 80, and traffic is forwarded to container port 8443 on matching Pods

Explanation

In a Service, port is the port exposed by the Service itself, while targetPort is the port on the target Pod/container receiving the forwarded traffic.

Common trap

In a Service, port is the port exposed by the Service itself, while targetPort is the port on the target Pod/container receiving the forwarded traffic.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

A Service named redis-svc has spec.clusterIP: None and a matching selector for StatefulSet Pods redis-0, redis-1, redis-2. What does a DNS query for redis-svc..svc.cluster.local return?

Choose one answer
Check answer and explanation

Correct answer: A records for the individual ready Pods rather than a single virtual cluster IP

Explanation

A headless Service (clusterIP: None) has no cluster IP and resolves directly to the IP addresses of matching ready Pods.

Common trap

A headless Service (clusterIP: None) has no cluster IP and resolves directly to the IP addresses of matching ready Pods.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

In a networking.k8s.io/v1 Ingress rule, what is the difference between pathType: Exact and pathType: Prefix for path /api?

Choose one answer
Check answer and explanation

Correct answer: Exact matches only the exact URL path /api (case-sensitive), whereas Prefix matches /api and any slash-delimited subpaths such as /api/v1

Explanation

Exact matches the URL path literally, while Prefix matches the path prefix along path element boundaries (such as /api and /api/items).

Common trap

Exact matches the URL path literally, while Prefix matches the path prefix along path element boundaries (such as /api and /api/items).

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

In a NetworkPolicy, you write ingress: [{ from: [{ namespaceSelector: { matchLabels: { team: frontend } } }, { podSelector: { matchLabels: { app: batch } } }] }] inside namespace app-ns. How does Kubernetes evaluate the two elements in the from array?

Choose one answer
Check answer and explanation

Correct answer: As logical OR: traffic is allowed from any Pod in a namespace labeled team: frontend OR from any Pod labeled app: batch inside app-ns

Explanation

Each element (- ...) inside from or to is evaluated independently and combined with logical OR, while fields inside a single element are combined with logical AND.

Common trap

Each element (- ...) inside from or to is evaluated independently and combined with logical OR, while fields inside a single element are combined with logical AND.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

What port range does Kubernetes allocate by default for NodePort Services?

Choose one answer
Check answer and explanation

Correct answer: 30000–32767

Explanation

By default, Kubernetes allocates NodePort values from the 30000–32767 range on cluster nodes.

Common trap

By default, Kubernetes allocates NodePort values from the 30000–32767 range on cluster nodes.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

When troubleshooting a ClusterIP Service that exists and has a matching selector, which command shows the endpoints currently backing the Service?

Choose one answer
Check answer and explanation

Correct answer: kubectl get endpointslices -l kubernetes.io/service-name= -n (or kubectl describe svc -n )

Explanation

Inspecting EndpointSlices (labeled with kubernetes.io/service-name) or kubectl describe svc shows whether matching ready Pod endpoints are attached to the Service.

Common trap

Inspecting EndpointSlices (labeled with kubernetes.io/service-name) or kubectl describe svc shows whether matching ready Pod endpoints are attached to the Service.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

Which command lists all Services in namespace backend?

Choose one answer
Check answer and explanation

Correct answer: kubectl get svc -n backend

Explanation

kubectl get svc (or kubectl get services) -n backend lists Services in the backend namespace.

Common trap

kubectl get svc (or kubectl get services) -n backend lists Services in the backend namespace.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

Which command temporarily forwards local port 9090 on your workstation to port 8080 on Pod metrics-0 in namespace monitoring?

Choose one answer
Check answer and explanation

Correct answer: kubectl port-forward pod/metrics-0 9090:8080 -n monitoring

Explanation

kubectl port-forward pod/ : -n forwards local traffic to the target Pod port.

Common trap

kubectl port-forward pod/ : -n forwards local traffic to the target Pod port.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

Which Ingress spec field specifies the IngressClass name in networking.k8s.io/v1 manifests?

Choose one answer
Check answer and explanation

Correct answer: spec.ingressClassName

Explanation

In networking.k8s.io/v1 Ingress, spec.ingressClassName references the IngressClass resource name.

Common trap

In networking.k8s.io/v1 Ingress, spec.ingressClassName references the IngressClass resource name.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

Which kubectl command exposes an existing Deployment named web on Service port 80 targeting container port 8080 as a ClusterIP Service?

Choose one answer
Check answer and explanation

Correct answer: kubectl expose deployment web --port=80 --target-port=8080

Explanation

kubectl expose deployment --port= --target-port= creates a ClusterIP Service using the Deployment's selector.

Common trap

kubectl expose deployment --port= --target-port= creates a ClusterIP Service using the Deployment's selector.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

Which NetworkPolicy in namespace isolated denies ALL inbound traffic to all Pods in namespace isolated?

Choose one answer
Check answer and explanation

Correct answer: spec: { podSelector: {}, policyTypes: [Ingress] }

Explanation

An empty podSelector: {} selects all Pods in the namespace, and policyTypes: [Ingress] with no ingress allow rules denies all ingress traffic to them.

Common trap

An empty podSelector: {} selects all Pods in the namespace, and policyTypes: [Ingress] with no ingress allow rules denies all ingress traffic to them.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

Which Service type exposes a Service on an external IP using the cloud provider's load balancer (where supported)?

Choose one answer
Check answer and explanation

Correct answer: LoadBalancer

Explanation

Service type LoadBalancer provisions an external load balancer (and typically also sets up NodePort and ClusterIP) to route external traffic to the Service.

Common trap

Service type LoadBalancer provisions an external load balancer (and typically also sets up NodePort and ClusterIP) to route external traffic to the Service.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

Which Service type returns a CNAME record pointing to an external DNS hostname (such as db.example.com) instead of using Pod selectors?

Choose one answer
Check answer and explanation

Correct answer: ExternalName

Explanation

Service type ExternalName maps the internal Service name to an external DNS name via externalName without using selectors or kube-proxy endpoints.

Common trap

Service type ExternalName maps the internal Service name to an external DNS name via externalName without using selectors or kube-proxy endpoints.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

Why does a NetworkPolicy have no effect on cluster traffic if the underlying CNI plugin does not enforce NetworkPolicies?

Choose one answer
Check answer and explanation

Correct answer: NetworkPolicies are declarative API objects that require a NetworkPolicy-capable CNI plugin to program firewall/dataplane rules

Explanation

Creating a NetworkPolicy object stores the rule in the API server, but actual packet filtering depends on a CNI plugin that implements NetworkPolicy enforcement.

Common trap

Creating a NetworkPolicy object stores the rule in the API server, but actual packet filtering depends on a CNI plugin that implements NetworkPolicy enforcement.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


CK.V · CKAD practice question

You create an Ingress in namespace shop with host: shop.example.com and backend Service web-svc on port 80, but curl to the Ingress controller returns 404 or default backend. What is a common cause on the Ingress resource itself?

Choose one answer
Check answer and explanation

Correct answer: Wrong ingressClassName, mismatched host/path, or wrong backend Service name/port

Explanation

Ingress routing fails or hits the default backend if ingressClassName does not match the controller, host/path rules do not match the request, or backend.service.name/port is incorrect.

Common trap

Ingress routing fails or hits the default backend if ingressClassName does not match the controller, host/path rules do not match the request, or backend.service.name/port is incorrect.

Source: Original unofficial practice; not an official CKAD exam item
Checked against the cited text on 2026-11-30.

Report an error in this question

Open this question on its own page


Back to all topics