Google Associate Cloud Engineer Question 112
Select 3Google Cloud PlatformYou are working as a Google Cloud Associate Cloud Engineer. You need to install and configure the Kubernetes CLI (kubectl) to manage your Google Kubernetes Engine (GKE) clusters. Which of the following steps should you perform to correctly install kubectl and configure it to use with your GKE cluster?
- A
Install kubectl using the gcloud components command.
- B
Install kubectl via Homebrew if you are on macOS.
- C
Use the gcloud container clusters get-credentials command to configure kubectl for your GKE cluster.
- D
Manually download the kubectl binary from the Kubernetes GitHub repository.
- E
Directly edit the kubeconfig file to add your cluster credentials.
Show answer and explanation
Correct answers: A, B, C
Explanation
To properly install and configure kubectl for use with GKE on Google Cloud Platform, it is recommended to use the gcloud command-line tool to install kubectl with gcloud components, or use a package manager like Homebrew on macOS. Once installed, the gcloud container clusters get-credentials command should be used to automatically configure kubectl with the necessary credentials to manage the GKE cluster. These methods ensure that kubectl is correctly installed and configured with minimal manual intervention, reducing the risk of errors.
- A. Correct.
Installing kubectl using gcloud components is a standard method on Google Cloud Platform, which ensures compatibility and easy installation.
- B. Correct.
Homebrew is a popular package manager for macOS, and it's a valid method to install kubectl efficiently.
- C. Correct.
Using gcloud container clusters get-credentials sets up the kubeconfig file to authenticate and interact with your GKE cluster automatically.
- D. Incorrect.
While manually downloading the kubectl binary is possible, it is not the recommended method for GCP users as it may not ensure compatibility or updates.
- E. Incorrect.
Directly editing the kubeconfig file is error-prone and not recommended when automated commands are available for configuration.