Exam KCNA All QuestionsBrowse all questions from this exam
Question 18

Which of the following workload require a headless service while deploying into the namespace?

    Correct Answer: A

    StatefulSet workloads require a headless service when deploying into the namespace. This is because StatefulSets are used for managing stateful applications that need unique network identities and stable, unique storage. Headless services allow each pod in a StatefulSet to be accessed individually by preserving their unique DNS entries, which is essential for maintaining the state and ensuring consistent communication between pods.

Discussion
dadaarceOption: A

Headless services are not typically required for the other workload types listed: CronJob: Executes Jobs at a scheduled time, but doesn't necessarily require a headless service. Deployment: Manages stateless applications and can use a standard service for load balancing. DaemonSet: Ensures that a copy of a pod runs on each node in the cluster, but doesn't require a headless service for normal operation.

phcunhaOption: A

A. StatefulSet Explanation: StatefulSets are used for applications that maintain a persistent state or have a unique identity, such as databases. Each pod in a StatefulSet typically has a unique name, and it's necessary to ensure discovery and communication between these pods consistently, even when they are scaled up or down. An analogy for StatefulSets could be managing a team of employees in an organization. Each employee has a unique name and a specific role. Even as the team grows or shrinks, it's important to maintain consistent communication among them. Therefore, you need a communication system (service) that can reliably locate each employee, regardless of changes in the team.

pulsefireOption: A

A. https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#:~:text=StatefulSets%20currently%20require%20a%20Headless%20Service%20to%20be%20responsible%20for%20the%20network%20identity%20of%20the%20Pods.%20You%20are%20responsible%20for%20creating%20this%20Service.