2V0-71.23 Question 13
Select 3You are a Kubernetes administrator managing a Tanzu Kubernetes Grid cluster. To deploy a stateless application, you need to define the number of replicas, expose the application via a stable network endpoint, and ensure the application can horizontally scale. Which combination of Kubernetes logical objects should you use to achieve this?
- A
Deployment
- B
Service
- C
ConfigMap
- D
Pod
- E
HorizontalPodAutoscaler
Show answer and explanation
Correct answers: A, B, E
Explanation
To deploy and manage a stateless application in Kubernetes, a combination of logical objects is required. Deployments manage the desired state of Pods and replicas. Services expose the application via a stable network endpoint, load balancing traffic to Pods. HorizontalPodAutoscalers enable dynamic scaling of replicas based on resource metrics. ConfigMaps and individual Pods are not sufficient for this use case as they do not address all the requirements of scaling, replication, and stable networking.
- A. Correct.
A Deployment is responsible for managing Pods and their replicas, ensuring desired state and high availability. It is essential for defining a stateless application with multiple replicas.
- B. Correct.
A Service provides a stable network endpoint and load balances traffic to the underlying Pods, which is necessary for exposing the application.
- C. Incorrect.
A ConfigMap is used for managing configuration data and is not directly involved in defining replicas, scaling, or exposing the application.
- D. Incorrect.
A Pod is the basic unit in Kubernetes, but it is not sufficient on its own for managing replicas, scaling, or stable network endpoints.
- E. Correct.
A HorizontalPodAutoscaler is used to automatically scale replicas based on resource usage, which is crucial for enabling horizontal scaling.