Certified Kubernetes Application Developer (CKAD) Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Enhance your skills for the CKAD exam. Study with curated quizzes and detailed explanations. Prepare effectively for your success!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What port on the service itself is defined in a NodePort service specification?

  1. targetPort

  2. nodePort

  3. port

  4. servicePort

The correct answer is: port

In a NodePort service specification, the port defined on the service itself is referred to as the `port`. This is the port that the service listens on internally within the cluster and is what clients within the cluster use to access the service. When a request is made to this port, it gets routed to the appropriate pods based on their labels. The `nodePort`, on the other hand, is a specific port that Kubernetes assigns to the service on each node in the cluster, allowing external traffic to access the service at that port via the node's IP address. The `targetPort` specifies the port on the container that the traffic should be directed to once it reaches the appropriate pod. The term `servicePort` is not standard in the context of Kubernetes service specifications, leading to confusion regarding its use. Thus, understanding that the `port` parameter is integral to the functionality of the service helps clarify the role it plays in allowing internal communication within a Kubernetes cluster.