ASSOCIATE-CLOUD-ENGINEER practice question 26 of 35
You are assigned to maintain a Google Kubernetes Engine (GKE) cluster named dev that was deployed on Google Cloud. You want to manage the GKE configuration using the command line interface (CLI). You have just downloaded and installed the Cloud SDK. You want to ensure that future CLI commands by default address this specific cluster. What should you do?
Full set: 332 questionsThe gcloud config set command is the standard method for setting properties in the active Cloud SDK configuration. To set a default value for a specific service, you use the format [group]/[property]. For Google Kubernetes Engine, the group is container and the property for the cluster name is cluster. Therefore, gcloud config set container/cluster dev correctly configures the CLI to use the 'dev' cluster for all subsequent gcloud container commands, eliminating the need to specify the --cluster flag each time.
B. The gcloud container clusters update command modifies the configuration of the GKE cluster resource on Google Cloud, not the local client-side CLI settings.
C. Manually creating a file named gke.default is not a recognized method for configuring the Cloud SDK. Configuration is managed via gcloud config commands.
D. Manually creating a defaults.json file is not the correct procedure for setting Cloud SDK properties. The CLI uses a structured configuration file managed by gcloud commands.
1. Google Cloud SDK Documentation
gcloud config set: "The gcloud config set command sets a property in your gcloud CLI configuration... For example
to set the default zone to us-central1-a
run: gcloud config set compute/zone us-central1-a". This demonstrates the command's usage and format. The same principle applies to container/cluster.
Source: Google Cloud. (n.d.). gcloud config set. Google Cloud SDK Documentation. Retrieved from https://cloud.google.com/sdk/gcloud/reference/config/set
2. Google Cloud SDK Documentation
Available Properties: The official documentation lists all available properties that can be set. Under the "container" section
the cluster property is defined as "The default cluster to use for container commands."
Source: Google Cloud. (n.d.). gcloud topic configurations. Google Cloud SDK Documentation. See the section on "Available Properties". Retrieved from https://cloud.google.com/sdk/gcloud/reference/topic/configurations
3. Google Kubernetes Engine Documentation
gcloud container: The documentation for the gcloud container command group implicitly relies on these configuration settings. For example
in the usage for gcloud container clusters describe [CLUSTERNAME]
it notes that flags like --zone can be omitted if the compute/zone property is set. This same logic applies to the container/cluster property for other commands.
Source: Google Cloud. (n.d.). gcloud container. Google Cloud SDK Documentation. Retrieved from https://cloud.google.com/sdk/gcloud/reference/container
Keep practicing
Take the free ASSOCIATE-CLOUD-ENGINEER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ASSOCIATE-CLOUD-ENGINEER practice questions
- Question 1You need to verify that a Google Cloud Platform service account was created at a particul…
- Question 2You are building a new version of an application hosted in an App Engine environment. You…
- Question 3You need to create a new billing account and then link it with an existing Google Cloud P…
- Question 4You want to configure 10 Compute Engine instances for availability when maintenance occur…
- Question 5You need to create a custom VPC with a single subnet. The subnet’s range must be as large…
- Question 6You significantly changed a complex Deployment Manager template and want to confirm that …
