Google Associate Cloud Engineer Question 203
Select 2Google Cloud PlatformYou are managing a Google Kubernetes Engine (GKE) cluster and need to upgrade a node pool to use a newer version of Kubernetes. Which of the following steps should you take to perform a rolling upgrade of the node pool without causing downtime for your workloads?
- A
Use the
gcloud container clusters upgradecommand to upgrade the entire cluster, including all node pools. - B
Drain the nodes in the node pool to ensure workloads are scheduled onto other nodes before upgrading.
- C
Use the
gcloud container node-pools upgradecommand to upgrade the specific node pool. - D
Delete the existing node pool and create a new node pool with the desired Kubernetes version.
- E
Ensure that cluster autoscaler is enabled to automatically adjust the size of the node pool during the upgrade.
Show answer and explanation
Correct answers: B, C
Explanation
To perform a rolling upgrade of a node pool in GKE without causing downtime, you should drain the nodes to ensure workloads are safely rescheduled and use the gcloud container node-pools upgrade command to upgrade the node pool to the desired Kubernetes version. This approach allows for a controlled upgrade process, maintaining high availability of the cluster.
- A. Incorrect.
This option upgrades the entire cluster, which might not be necessary if you only want to upgrade a specific node pool.
- B. Correct.
Draining nodes ensures that workloads are safely evicted and rescheduled, minimizing downtime during the upgrade process.
- C. Correct.
This command upgrades the specified node pool and is the recommended approach for upgrading node pools without affecting other parts of the cluster.
- D. Incorrect.
Deleting and recreating a node pool can cause downtime and data loss if not done carefully, and is not the recommended way to upgrade a node pool.
- E. Incorrect.
While the cluster autoscaler can help manage node resources, it is not directly involved in the node pool upgrade process.