Google Associate Cloud Engineer Question 208
Single answerGoogle Cloud PlatformYou are tasked with deploying a new application on Google Kubernetes Engine (GKE) and need to ensure that it can handle a minimum of 3 replicas for high availability. Which Kubernetes resource configuration should you modify to achieve this requirement?
- A
Modify the Service resource to set the replicas to 3.
- B
Adjust the Deployment resource to specify a replica count of 3.
- C
Change the Node Pool size to ensure it has 3 nodes.
- D
Configure a Pod resource to explicitly set the number of replicas to 3.
Show answer and explanation
Correct answer: B
Explanation
In Kubernetes, a Deployment resource is used to manage a set of Pods and can specify the desired state of these Pods, including the number of replicas. By setting the replicas in a Deployment to 3, you ensure that the Kubernetes system maintains three running instances of your application, providing high availability.
- A. Incorrect.
The Service resource is used to expose applications running on a set of Pods, not to manage the number of replicas.
- B. Correct.
The Deployment resource is responsible for declaring the desired state for a set of Pods, including the replica count. Setting the replica count to 3 ensures that there are always 3 running instances of the application.
- C. Incorrect.
The Node Pool size refers to the number of nodes available in the GKE cluster, not the number of replicas of an application.
- D. Incorrect.
The Pod resource defines a single instance of a running application; it does not manage replicas. The Deployment or ReplicaSet manages replicas.