Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
A cloud engineer creates a new Google Kubernetes Engine (GKE) cluster named prod-cluster in the us-central1-a zone. The engineer is logged into the Google Cloud CLI on their workstation, but running kubectl get nodes results in an error because kubectl lacks the endpoint and authentication information for the newly created cluster.
Which command should the engineer run to automatically retrieve the cluster credentials and populate the local kubeconfig file?
gcloud container clusters get-credentials isThe gcloud container clusters get-credentials command is the primary Google Cloud CLI utility used to securely fetch authentication credentials and endpoint details for a specified Google Kubernetes Engine (GKE) cluster. It automatically constructs or updates a local kubeconfig file (typically stored at $HOME/.kube/config).
kubeconfig automatically: It creates a dedicated cluster context, user entry, and cluster definition inside the kubeconfig file without requiring manual YAML editing.kubectl, enabling immediate management via kubectl get nodes or deployment manifests.--zone us-central1-a ensures gcloud unambiguously identifies the exact zonal cluster location within the project.gcloud auth login session to pass authentication tokens to kubectl.kubectl context seamlessly across multiple clusters.Running gcloud container clusters get-credentials is the standard, Google-recommended practice for configuring kubectl workstation access. It executes all required configuration steps in a single automated command.
gcloud auth application-default login doesThe gcloud auth application-default login command generates and stores local credentials for Application Default Credentials (ADC), which are used by client libraries (such as Google Cloud client libraries for Python, Java, or Go) to authenticate API requests made from your local development environment.
$HOME/.kube/config.kubectl contexts.kubectl error: Running this command leaves kubectl without any cluster connection parameters, so kubectl get nodes will continue to fail.You were developing a custom software application locally that utilizes Google Cloud SDK client libraries to call Google Cloud APIs on your behalf.
kubectl config set-credentials doesThe kubectl config set-credentials command is a client-side kubectl sub-command used to manually write raw user credentials or authentication plugin parameters into a local kubeconfig file.
users section in kubeconfig. It does not contact the GKE control plane to fetch cluster API endpoints or CA certificates.kubeconfig requires three distinct elements—a cluster, a user, and a context linking them together. Setting credentials alone does not create the cluster endpoint definition or the binding context.kubectl flags is complex and does not automatically query the Google Cloud API for cluster details.kubectl without the IP address or domain required to route requests to the cluster.set-cluster, set-credentials, set-context, and use-context).You were manually building a custom kubeconfig file from static tokens or client certificates without using the Google Cloud CLI automation.
gcloud container clusters describe doesThe gcloud container clusters describe command queries the GKE API and outputs a full JSON or YAML representation of the cluster's configuration and status to standard output (stdout).
kubeconfig: While the output includes details such as node pool status, network settings, and the control plane endpoint IP, it does not write or format any context entries inside $HOME/.kube/config.kubectl unconfigured: Because no local Kubernetes configuration file is modified or generated, running kubectl commands will continue to fail.kubectl.The goal were to inspect cluster metadata, check control plane status, verify node pool versions, or locate the canonical cluster endpoint from the terminal output without configuring kubectl.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated