Courseiva

CKA · domain

Services and Networking

The Services and Networking domain covers how pods communicate inside and outside the cluster: Service types (ClusterIP, NodePort, LoadBalancer), CoreDNS name resolution, kube-proxy modes, Ingress, and NetworkPolicy. It is tested through scenario questions and hands-on tasks where you create or troubleshoot Services, resolve cross-namespace DNS names, and reason about traffic allowed or denied by NetworkPolicy rules.

131 questions35 easy66 medium30 hard

Focused practice

Practice Services and Networking questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Services and Networking

Be able to create and debug Services, Ingress, and NetworkPolicy objects, and explain DNS resolution and kube-proxy behavior. The single most important thing: know that a NetworkPolicy selecting pods with no ingress rules denies all ingress traffic to those pods.

Creating and exposing workloads with ClusterIP, NodePort, and LoadBalancer Services using kubectl expose or YAML manifests

Resolving Services by DNS, including cross-namespace names like db-service.production.svc.cluster.local

Understanding kube-proxy modes (iptables, IPVS) and how Service traffic is routed to pod endpoints

Writing NetworkPolicy ingress and egress rules that select pods by labels and restrict traffic by port or namespace

Watch out for

Common Services and Networking exam traps

  • ▸Assuming a NetworkPolicy with no ingress rules allows all traffic; an empty ingress rule set actually denies all ingress to the selected pods.
  • ▸Using a short service name across namespaces; from another namespace you must use the fully qualified name or service.namespace.
  • ▸Forgetting that a Service selects pods by labels and that a label mismatch leaves the Service with no endpoints, so connections fail.

Question index

All Services and Networking questions (131)

Click any question to see the full explanation, or start a practice session above.

1

You need to create a Service that exposes port 80 on each node's IP at a static port (30080). Which Service type should you use?

Easy
2

You create a ClusterIP service named 'my-svc' in the 'default' namespace. A pod in the same namespace tries to reach the service using the DNS name 'my-svc'. Which fully qualified domain name (FQDN) should the pod use to resolve the service?

Medium
3

Which two of the following are valid methods for service discovery in Kubernetes?

Medium
4

A NetworkPolicy named 'default-deny-ingress' is applied to all pods in a namespace. The policy has no rules. An administrator then creates a new NetworkPolicy that allows ingress traffic to pods with label 'app: web' from any source using a podSelector with '{}'. Will traffic be allowed to pods labeled 'app: web'?

Hard
5

Which TWO of the following are valid kube-proxy modes?

Easy
6

Which THREE of the following are valid methods for service discovery in Kubernetes?

Medium
7

A pod 'my-pod' in the 'default' namespace cannot resolve the service 'db-service' in the 'production' namespace. Which DNS name should be used to reach the service from 'my-pod'?

Medium
8

You create a Deployment with 3 replicas and a ClusterIP Service. You notice that some pods are not receiving traffic. What is the most likely cause?

Medium
9

Which Service type exposes a Service on each Node's IP at a static port in the range 30000-32767?

Easy
10

Which TWO of the following are valid ways to expose a Service externally? (Select TWO.)

Medium
11

Which THREE of the following are CNI plugins?

Easy
12

Which of the following is NOT a valid Service type in Kubernetes?

Easy
13

Which kube-proxy mode supports connection-based load balancing using Linux IPVS?

Easy
14

Which resource is used to configure TLS termination and path-based routing for HTTP(S) traffic into a cluster?

Easy
15

A NetworkPolicy allows ingress from pods with label 'role: frontend'. Which field is used to select those pods?

Medium
16

You apply the following NetworkPolicy: ```yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-all spec: podSelector: {} policyTypes: - Ingress - Egress ``` What is the result?

Hard
17

What is the default DNS name for a service named 'my-svc' in namespace 'default'?

Easy
18

What is the default kube-proxy mode in modern Kubernetes clusters?

Medium
19

You apply the following NetworkPolicy to namespace 'ns1': apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-ingress spec: podSelector: {} policyTypes: - Ingress ingress: [] What effect does this policy have?

Hard
20

Which of the following commands can be used to check the endpoints of a service named 'my-service'?

Medium
21

Which Service type is used to expose a service externally with a cloud provider's load balancer?

Easy
22

You need to expose a Service externally using an Ingress. The Ingress controller requires a specific IngressClass. How do you specify the IngressClass in the Ingress resource?

Medium
23

A cluster administrator needs to allow pods labeled 'app=web' in namespace 'frontend' to receive TCP traffic on port 443 only from pods labeled 'app=proxy' in namespace 'backend'. The cluster uses the default CNI plugin that enforces NetworkPolicy. The administrator creates a NetworkPolicy in the 'frontend' namespace with podSelector matching 'app=web', policyTypes: ['Ingress'], and an ingress rule with from: [{namespaceSelector: {matchLabels: {name: 'backend'}}, podSelector: {matchLabels: {app: 'proxy'}}}], ports: [{protocol: 'TCP', port: 443}]. However, the namespace 'backend' is not labeled with 'name=backend'. What is the effect of this policy?

Medium
24

A developer runs `kubectl run nginx --image=nginx --port=80` and then `kubectl expose pod nginx --port=80 --target-port=80 --type=NodePort`. What is the name of the created Service?

Medium
25

What is the default DNS name for a Service named 'my-service' in namespace 'my-ns'?

Easy
26

Which TWO commands can be used to test DNS resolution for a Service named 'my-svc' in namespace 'default' from within a temporary pod? (Choose 2)

Medium
27

Which two of the following are valid methods for exposing a Service externally in Kubernetes? (Select TWO.)

Medium
28

Which of the following Service types exposes a Service on a static port on each node's IP?

Easy
29

You want to expose a Deployment named 'web' on port 80 internally within the cluster. Which command creates a ClusterIP Service?

Medium
30

A NetworkPolicy named 'deny-all' is applied to a namespace with podSelector: {}. The policy has no ingress rules. What is the effect?

Hard
31

Which of the following service types exposes a service on a static port on each node's IP address?

Easy
32

You want to configure NetworkPolicy to allow ingress traffic only from pods with label 'role: frontend' in the same namespace. Which podSelector should be in the ingress rule?

Hard
33

What is the default kube-proxy mode in Kubernetes v1.29?

Easy
34

Which Service type exposes a Service externally via a cloud provider's load balancer?

Easy
35

You need to expose multiple HTTP services on a single IP address with path-based routing. Which resource should you use?

Medium
36

You update a NetworkPolicy to add an egress rule. After applying, pods affected by the policy can no longer reach external IPs. What is the most likely reason?

Medium
37

A NetworkPolicy named 'deny-all' is created with an empty podSelector and no rules. What does this policy accomplish?

Hard
38

A pod cannot resolve a service DNS name. The cluster uses CoreDNS. Which of the following is the most likely cause if the pod's /etc/resolv.conf contains 'nameserver 10.96.0.10' and the CoreDNS pod is running?

Hard
39

You have a NodePort service. Which kube-proxy mode allows for better performance and more sophisticated load balancing algorithms like 'least connection'?

Hard
40

Which of the following Service types does NOT assign a ClusterIP to the Service?

Easy
41

Which of the following is a valid CNI plugin for Kubernetes networking?

Easy
42

An administrator runs `kubectl port-forward service/my-svc 8080:80`. What does this command do?

Medium
43

Which kube-proxy mode uses iptables rules to handle service traffic?

Easy
44

You need to temporarily access a pod's HTTP endpoint on port 8080 from your local machine on port 8080. Which kubectl command should you use?

Easy
45

You run `kubectl port-forward service/my-svc 8080:80`. What does this command do?

Medium
46

Which command forwards local port 8080 to port 80 of a pod named 'web-pod'?

Easy
47

A developer runs 'kubectl port-forward service/my-svc 8080:80' and reports that connections to localhost:8080 fail. The service is a ClusterIP service that selects pods with label 'app: my-app'. What is the most likely cause?

Hard
48

Which of the following is the default DNS name for a Service named 'my-svc' in namespace 'my-ns'?

Medium
49

You have a headless service named 'my-headless' with clusterIP: None. A pod in the same namespace queries the DNS name 'my-headless'. What will the DNS response contain?

Medium
50

You have a NetworkPolicy that selects pods with label 'app: db'. The policy has an ingress rule allowing traffic from pods with label 'app: frontend'. A pod with label 'app: frontend' is in a different namespace. No namespaceSelector is specified in the ingress rule. Will traffic from that pod be allowed?

Hard
51

You run 'kubectl get svc my-service -o yaml' and see 'type: ClusterIP'. The service has no endpoints. What is the most likely cause?

Medium
52

What is the DNS name for a Service named 'api' in the 'default' namespace?

Medium
53

You create a Service of type LoadBalancer in a Kubernetes cluster that does not have an external load balancer provider (e.g., bare-metal). What will be the state of the EXTERNAL-IP field when you run 'kubectl get svc'?

Medium
54

You apply the following NetworkPolicy: apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-all spec: podSelector: {} policyTypes: - Ingress What effect does this policy have?

Medium
55

You have an Ingress resource with the following spec: spec: rules: - host: example.com http: paths: - path: /api pathType: Prefix backend: service: name: api-service port: number: 80 A client sends a request to http://example.com/api/v1/users. Which path is matched?

Hard
56

Which three components are part of the Gateway API? (Choose three.)

Hard
57

An Ingress resource is created with the following spec: spec: rules: - host: example.com http: paths: - path: /api pathType: Prefix backend: service: name: api-service port: number: 80 The backend service 'api-service' is in the same namespace as the Ingress. What must be true for the Ingress to route traffic to the service?

Medium
58

You want to forward local port 8080 to port 80 of a pod named 'nginx-pod'. Which command should you use?

Medium
59

Which TWO statements about Headless services are correct? (Select TWO)

Medium
60

You have a NetworkPolicy that selects pods with label 'role: db' in the 'default' namespace. The policy has no ingress rules defined. What is the effect on traffic to the selected pods?

Medium
61

Which of the following is a correct Ingress resource snippet that routes traffic to service 'web-svc' on port 80 for the host 'example.com'?

Medium
62

You have a Service with endpoints for pods in different zones. You want kube-proxy to use a mode that provides better performance for large clusters and supports scheduling algorithms like least-connection. Which mode should you use?

Hard
63

Which THREE components are required for a pod to resolve a Service DNS name?

Medium
64

Which resource type is used to configure HTTP/HTTPS routing to Services?

Easy
65

A developer runs 'kubectl port-forward service/my-service 8080:80'. What does this command do?

Medium
66

Which TWO statements about EndpointSlices are correct?

Hard
67

You have a kube-proxy running in ipvs mode. Which of the following is true about IPVS?

Hard
68

You run `kubectl expose deployment web --port=80 --target-port=8080 --type=NodePort` and the Service is created. What is the effect of this command?

Medium
69

An ingress resource is defined with the following snippet: ```yaml spec: tls: - hosts: - app.example.com secretName: app-tls rules: - host: app.example.com http: paths: - path: / pathType: Prefix backend: service: name: app-service port: number: 80 ``` The secret 'app-tls' exists and contains a valid certificate. However, accessing https://app.example.com returns a certificate warning in the browser. What is the most likely cause?

Hard
70

You need to expose a service named 'my-svc' on a static port 30080 on every node. Which service type should you use?

Medium
71

You have a service 'my-svc' of type ClusterIP with no selector defined. You manually create an Endpoints object with the same name. Which statement is true?

Medium
72

A pod in namespace 'ns1' cannot resolve the DNS name 'svc.ns2.svc.cluster.local'. What is the most likely cause?

Medium
73

Which TWO of the following are valid ways to expose a Service externally in a Kubernetes cluster running on-premises (no cloud provider)?

Medium
74

Which two of the following are correct statements about EndpointSlices?

Medium
75

You have an Ingress resource with a TLS section specifying a secret named 'tls-secret'. The certificate in 'tls-secret' is expired. What happens when a client connects via HTTPS to the Ingress host?

Hard
76

A Kubernetes cluster uses kube-proxy in iptables mode. A Service named 'web-svc' of type ClusterIP has three endpoints: pod A (10.244.1.5:8080), pod B (10.244.2.6:8080), and pod C (10.244.3.7:8080). A client pod repeatedly sends requests to the Service's ClusterIP. The administrator observes that all requests from a single client pod are being routed to pod A, even though pod B and pod C are healthy. Which of the following is the most likely explanation?

Hard
77

You have a Service named 'my-service' in namespace 'ns1'. Another pod in namespace 'ns2' needs to resolve 'my-service' using DNS. What FQDN should the pod use?

Medium
78

A NetworkPolicy named 'deny-all' has only a podSelector matching all pods and no rules. What is the effect?

Medium
79

Which component is responsible for implementing the NetworkPolicy rules?

Medium
80

You want to debug a Service that is not reachable. Which kubectl command can you use to forward a local port to a pod in the Service?

Easy
81

Which annotation is commonly used with ExternalDNS to specify the DNS hostname for a Service?

Medium
82

Which Kubernetes Service type exposes the Service on a static port on each Node's IP address, allowing external access without a LoadBalancer?

Easy
83

Which kube-proxy mode uses iptables rules to handle service traffic and is the default in many distributions?

Medium
84

You create a Service with clusterIP: None. What is this called and what is its purpose?

Medium
85

A developer asks you to create a Service that resolves to an external database at 'db.example.com'. Which Service type should you use?

Medium
86

Which annotation is commonly used with the ExternalDNS project to manage DNS records for a Kubernetes service?

Medium
87

Which kube-proxy mode uses IP Virtual Server (IPVS) for load balancing and supports more algorithms than the default mode?

Medium
88

A pod is unable to resolve DNS names of services in other namespaces. Which DNS configuration is most likely missing?

Medium
89

After creating a NetworkPolicy that selects pods with label 'role: db' and allows ingress on TCP port 3306 from pods with label 'role: api', you notice that pods with label 'role: db' are still reachable on port 3306 from pods without 'role: api' label. What is the most likely cause?

Medium
90

Which THREE components are part of the Gateway API?

Medium
91

You have a Service 'my-svc' with ClusterIP None (headless). You create a StatefulSet with 3 replicas and a headless Service. How do you reach individual pods?

Hard
92

Which NetworkPolicy rule will allow ingress traffic from pods with label 'role: frontend' in the same namespace?

Easy
93

Which DNS record does CoreDNS create for a headless Service named 'headless-svc' in the namespace 'default'?

Easy
94

Which of the following is the default DNS name for a Service named 'api' in namespace 'production'?

Easy
95

You want to expose an application running in the cluster on a public IP address. Which Service type should you use?

Medium
96

You have a NetworkPolicy that denies all ingress traffic by default, and you want to allow traffic only from pods with label 'app: monitoring' in the same namespace. What should the policy spec look like?

Hard
97

Which THREE components are part of the Gateway API resource model? (Select THREE)

Hard
98

A pod cannot resolve a Service name 'my-svc' in the same namespace. The DNS pod is running. What is a likely cause?

Medium
99

An administrator creates a NetworkPolicy in namespace 'app' with the following YAML. Which statement is true about the policy? apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-all spec: podSelector: {} policyTypes: - Ingress

Easy
100

You have three pods selected by a service. One pod is in 'CrashLoopBackOff' state. How does the service's endpoints behave?

Hard
101

Which of the following is a core component of the Gateway API?

Easy
102

Which FOUR are correct ways to configure a default deny all ingress traffic NetworkPolicy? (Choose 4)

Hard
103

A cluster uses Flannel as the CNI plugin. Which of the following best describes Flannel's networking model?

Medium
104

Which TWO of the following are components of the Ingress API? (Select TWO.)

Medium
105

A Kubernetes cluster has a Service of type ClusterIP named 'my-svc' in the 'default' namespace. You deploy a pod and want it to resolve the service's cluster IP using DNS. What FQDN should the pod use?

Medium
106

Which of the following CNI plugins typically uses BGP to distribute routing information across nodes?

Hard
107

Which of the following is a valid use case for a Headless Service?

Easy
108

In a Kubernetes cluster using CoreDNS, what is the DNS name for a Service named 'api' in namespace 'backend'?

Medium
109

You want to temporarily access a pod's HTTP endpoint on port 8080 from your local machine on port 9090. Which command should you use?

Easy
110

Which kubectl command correctly retrieves the list of EndpointSlices for a Service named 'my-svc' in the 'default' namespace?

Medium
111

What is the default DNS name for a Service named 'my-svc' in namespace 'my-ns'?

Easy
112

An Ingress resource uses 'networking.k8s.io/v1' API. Which field specifies the hostname and path rules for routing traffic?

Medium
113

Which TWO network plugins (CNI) are commonly used in Kubernetes clusters? (Select TWO)

Medium
114

A NetworkPolicy allows ingress traffic from pods with label 'app: frontend' in any namespace. Which selector is used?

Hard
115

You run: kubectl expose deployment web --port=80 --target-port=8080 --type=LoadBalancer --name=web-svc. What is the effect of this command?

Medium
116

Which TWO statements about EndpointSlices are true? (Choose 2)

Medium
117

Which of the following can be used to expose a set of pods externally to the internet in a Kubernetes cluster? (Select THREE.)

Medium
118

What is the purpose of a headless Service (clusterIP: None)?

Easy
119

Which Ingress resource field is used to specify the hostname for which traffic should be routed?

Medium
120

Which TWO statements about Ingress in Kubernetes are correct?

Medium
121

You need to expose a Deployment named 'web' on port 80 inside the cluster. Which kubectl command creates a ClusterIP service?

Easy
122

Which two of the following are valid service discovery methods in Kubernetes? (Choose two.)

Easy
123

A cluster has kube-proxy running in ipvs mode. An administrator creates a Service of type ClusterIP. Which of the following is true about how traffic is forwarded to the pods?

Hard
124

Which THREE of the following are true about NetworkPolicy in Kubernetes? (Select 3)

Hard
125

You have a Deployment with 3 replicas. You create a headless service (clusterIP: None) with a label selector. Which of the following is true about DNS resolution for this service?

Hard
126

Which TWO statements are true about Ingress in Kubernetes?

Medium
127

A developer runs 'kubectl run nginx --image=nginx --expose --port=80'. What Kubernetes resources are created?

Medium
128

Which DNS record type does Kubernetes use to resolve a Service's ClusterIP?

Easy
129

A NetworkPolicy with podSelector: {} and policyTypes: [Ingress] is applied to a namespace. What is the effect on pods in that namespace?

Hard
130

Which kubectl command will expose a deployment named 'web-app' as a NodePort service on port 80?

Easy
131

Which THREE statements about NetworkPolicy are correct?

Hard

Frequently asked questions

What does the Services and Networking domain cover on the CKA exam?
Be able to create and debug Services, Ingress, and NetworkPolicy objects, and explain DNS resolution and kube-proxy behavior. The single most important thing: know that a NetworkPolicy selecting pods with no ingress rules denies all ingress traffic to those pods.
How many questions are in this domain?
This page lists all 131 Services and Networking questions in the CKA question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Services and Networking questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
cncf-cka CNCF-CKA cka services networking Practice Questions