Question

Difficulty: MediumDeploying and Managing Google Kubernetes Engine (GKE) Clusters and Workloads

A Cloud Engineer is establishing command-line administration for a newly deployed Google Kubernetes Engine (GKE) cluster named `analytics-cluster` in zone `us-central1-a`. The engineer also needs to configure node pools to host a stateful, non-fault-tolerant database workload. Which two actions should the engineer perform to fulfill these operational requirements? (Select TWO.)

  1. Run `gcloud container clusters get-credentials analytics-cluster --zone us-central1-a` to populate the local kubeconfig file with cluster endpoint and authentication details.Answer
  2. Provision a dedicated node pool using standard On-Demand Compute Engine VM instances for the database workload.Answer
  3. C
    Execute `gcloud config set container/cluster analytics-cluster` to generate client certificates and set up kubectl cluster context.
  4. D
    Configure a Spot VM node pool for the database workload to minimize compute infrastructure costs.

Answer

The engineer must run `gcloud container clusters get-credentials analytics-cluster --zone us-central1-a` to configure local `kubectl` authentication, and provision standard On-Demand Compute Engine node pools for the stateful, non-fault-tolerant database workload.
To grant `kubectl` command-line access to a GKE cluster, administrators must fetch credentials via `gcloud container clusters get-credentials`, which updates the local `kubeconfig` file. Additionally, stateful and non-fault-tolerant workloads such as databases require persistent compute availability, making standard On-Demand node pools the correct architectural choice.

Step-by-Step Solution

1
Identify the proper command to configure cluster credentials for kubectl access.
Using `gcloud container clusters get-credentials analytics-cluster --zone us-central1-a` fetches the necessary cluster endpoint data and access tokens, inserting them into `~/.kube/config`.
kubectl requires active credentials and endpoint configuration stored in the kubeconfig file to execute control plane operations.
2
Evaluate infrastructure requirements for a non-fault-tolerant, stateful database workload.
Select standard On-Demand Compute Engine instances for the database node pool.
Preemptible or Spot VMs can be reclaimed by Google Cloud at any time, leading to unexpected termination and potential data corruption for stateful applications.

Key Concept

GKE kubectl credential configuration and workload-to-node pool matching strategy
Rate this question