Google Associate Cloud Engineer Question 115
Select 3Google Cloud PlatformYou are a Google Cloud Engineer tasked with managing Kubernetes clusters on Google Kubernetes Engine (GKE). You need to install and configure the Kubernetes command line tool, kubectl, on your local machine to interact with your GKE clusters. Which of the following steps must you complete to ensure kubectl is correctly configured to manage your GKE clusters?
- A
Install kubectl using the Google Cloud SDK.
- B
Authenticate using the command 'gcloud auth login'.
- C
Configure kubectl to use the GKE cluster using the command 'kubectl config use-context'.
- D
Install kubectl using a package manager like apt or brew.
- E
Initialize gcloud to set a default project and compute zone using 'gcloud init'.
Show answer and explanation
Correct answers: A, B, E
Explanation
For managing GKE clusters, it's essential to install kubectl via the Google Cloud SDK to ensure version compatibility. Authentication through 'gcloud auth login' and setting up your environment with 'gcloud init' are crucial steps to ensure that kubectl can interact with the GKE clusters using the correct credentials and configurations.
- A. Correct.
Installing kubectl using the Google Cloud SDK is recommended for compatibility with GKE and ensures you have the latest version supported by Google Cloud.
- B. Correct.
Authenticating with 'gcloud auth login' is necessary to ensure that you have the proper credentials to interact with your GKE clusters.
- C. Incorrect.
While 'kubectl config use-context' is used to switch between different contexts, it is not necessary immediately after installation if the context is correctly set by 'gcloud'.
- D. Incorrect.
While installing kubectl using a package manager is possible, using the Google Cloud SDK is specifically recommended for GKE to ensure compatibility.
- E. Correct.
Running 'gcloud init' helps set up your default project and compute zone, which is important for managing resources on Google Cloud, including GKE clusters.