A DevOps engineer has created a new Google Kubernetes Engine (GKE) cluster named `app-cluster` in the `us-west1-a` zone. Before deploying workloads using `kubectl`, the engineer must configure local command-line credentials for this cluster. Which command should the engineer execute to populate the local `kubeconfig` file?
- gcloud container clusters get-credentials app-cluster --zone us-west1-aCevap
- Bgcloud config set container/cluster app-cluster
- Cgcloud container clusters describe app-cluster --zone us-west1-a
- Dgcloud compute instances get-credentials app-cluster --zone us-west1-a
Cevap
The command `gcloud container clusters get-credentials app-cluster --zone us-west1-a` is correct because it downloads the cluster endpoint and authentication credentials required by `kubectl` to interact with the GKE cluster.
Executing `gcloud container clusters get-credentials app-cluster --zone us-west1-a` retrieves the cluster endpoint and authentication credentials from Google Cloud and updates the local `kubeconfig` file, allowing `kubectl` commands to target the specified cluster.
Adım Adım Çözüm
Anahtar Kavram
Fetching GKE cluster authentication credentials for kubectl configuration