Google Associate Cloud Engineer Question 113
Select 2Google Cloud PlatformYou are an Associate Cloud Engineer tasked with managing Kubernetes clusters on Google Kubernetes Engine (GKE). You need to install and configure kubectl on your local machine to interact with your GKE cluster. Which of the following steps should you perform to correctly install and configure kubectl for GKE?
- A
Install kubectl using the Google Cloud SDK by running 'gcloud components install kubectl'.
- B
Download the kubectl binary from the Kubernetes GitHub repository and add it to your system's PATH manually.
- C
Use the command 'gcloud container clusters get-credentials [CLUSTER_NAME]' to configure kubectl to authenticate with your GKE cluster.
- D
Install kubectl through a package manager such as apt or yum without any additional configuration steps.
- E
Run 'kubectl create cluster' to initialize a connection with your GKE cluster.
Show answer and explanation
Correct answers: A, C
Explanation
To effectively manage GKE clusters, it's important to both install kubectl in a way that ensures compatibility with Google Cloud, and configure it to authenticate with your GKE cluster. Using 'gcloud components install kubectl' ensures you have a version of kubectl that is compatible with GCP, while 'gcloud container clusters get-credentials [CLUSTER_NAME]' is necessary to set up authentication and API access to your specific GKE cluster.
- A. Correct.
This is a recommended method to install kubectl for Google Cloud environments because it ensures compatibility with GKE.
- B. Incorrect.
While you can download kubectl from the Kubernetes GitHub repository, it requires manual configuration and is not specific to GKE.
- C. Correct.
This command configures kubectl to use the credentials for accessing your GKE cluster, which is essential for authentication.
- D. Incorrect.
Installing kubectl via a package manager may not guarantee that it is correctly configured for GKE, and additional steps are usually required.
- E. Incorrect.
This is incorrect because 'kubectl create cluster' is not a valid command for initializing a connection with an existing GKE cluster.