Certified Kubernetes Application Developer (CKAD) Practice Test

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

Prepare for the Certified Kubernetes Application Developer (CKAD) Exam. Gain confidence with flashcards and multiple-choice questions, complete with hints and explanations. Achieve your certification with ease!

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.


Which property must be specified in a pod spec to associate it with a headless service?

  1. hostname and subdomain properties

  2. serviceName property

  3. volumeClaimTemplate property

  4. storageClass property

The correct answer is: hostname and subdomain properties

To associate a pod with a headless service, the pod specification must include the `hostname` and `subdomain` properties. A headless service is a service in Kubernetes that does not maintain a virtual IP address, allowing DNS to return the IP addresses of the individual pods backing the service instead. When a pod is configured with these properties, it enables the creation of DNS A records for the pods that are associated with the headless service. The `hostname` property specifies the name of the pod, while the `subdomain` property specifies the domain name in which the hostname will be resolved within the context of the service, effectively allowing DNS queries to return entries that point directly to the pod's IP address. This connection is crucial for use cases where direct access to individual pods is necessary, such as when implementing stateful applications or for custom service discovery methods. Without configuring these properties, a headless service will not function as intended since there will be no unique DNS entries for the associated pods. Other properties like `serviceName`, `volumeClaimTemplate`, and `storageClass` do not directly impact the establishment of a headless service's association with the pod. The `serviceName` is relevant for referencing a service but does not