A lead developer at a logistics firm needs to administer workloads on a newly deployed Google Kubernetes Engine (GKE) Autopilot cluster named `logistics-tracking-prod` in the `europe-west1` region. Although the developer has authenticated to Google Cloud via `gcloud auth login`, running `kubectl get pods` fails with an error indicating that the connection to `localhost:8080` was refused. Which `gcloud` command must the developer execute to update local cluster credentials and enable `kubectl` management?
- gcloud container clusters get-credentials logistics-tracking-prod --region europe-west1Cevap
- Bgcloud config set container/cluster logistics-tracking-prod
- Cgcloud container node-pools create default-pool --cluster logistics-tracking-prod --region europe-west1
- Dgcloud container clusters create logistics-tracking-prod --spot --region europe-west1
Cevap
Execute `gcloud container clusters get-credentials logistics-tracking-prod --region europe-west1` to write cluster credentials and endpoint details into the local `kubeconfig` file.
Running the command `gcloud container clusters get-credentials logistics-tracking-prod --region europe-west1` fetches the endpoint details and security credentials for the GKE cluster and writes them into the local user's `kubeconfig` file, allowing `kubectl` commands to correctly locate and authenticate with the remote control plane.
Adım Adım Çözüm
Anahtar Kavram
Configuring local kubectl context for GKE clusters using gcloud get-credentials
Tahmini Süre:1m 30s