CKA CKA Services and Ingress 1 — Questions and Answers
Question 1: Which Service type exposes a service only within the Kubernetes cluster on an internal IP?
- NodePort
- LoadBalancer
- ClusterIP (Correct answer)
- ExternalName
Correct answer: ClusterIP
ClusterIP is the default service type that assigns an internal cluster IP, making the service reachable only within the cluster.
Question 2: Which Service type exposes an application on a static port on every node's IP?
- ClusterIP
- NodePort (Correct answer)
- LoadBalancer
- Headless
Correct answer: NodePort
NodePort exposes the service on each Node's IP at a static port in the range 30000–32767.
Question 3: What is the default port range for NodePort services in Kubernetes?
- 1024–65535
- 8080–9090
- 30000–32767 (Correct answer)
- 20000–30000
Correct answer: 30000–32767
NodePort services allocate ports from the range 30000–32767 by default, configurable via `--service-node-port-range` on the API server.
Question 4: Which Service type automatically provisions an external cloud load balancer?
- NodePort
- Ingress
- ClusterIP
- LoadBalancer (Correct answer)
Correct answer: LoadBalancer
The LoadBalancer service type requests an external load balancer from the cloud provider to route traffic to the service.
Question 5: What does setting `clusterIP: None` on a Service create?
- An external service with no cluster IP
- A Headless Service for direct pod DNS discovery (Correct answer)
- A service that rejects all traffic
- An ExternalName alias
Correct answer: A Headless Service for direct pod DNS discovery
Setting `clusterIP: None` creates a Headless Service that returns individual pod IPs via DNS instead of a single virtual IP.
Question 6: Which Service type creates a DNS CNAME alias pointing to an external hostname?
- ExternalName (Correct answer)
- External
- ClusterIP with externalIPs
- NodePort
Correct answer: ExternalName
ExternalName service maps a Kubernetes service to an external DNS name by returning a CNAME record for the configured hostname.
Which Service type exposes a service only within the Kubernetes cluster on an internal IP?