Exam4Training

What should you do?

You are using multiple configurations for gcloud. You want to review the configured Kubernetes Engine cluster of an inactive configuration using the fewest possible steps.

What should you do?
A . Use gcloud config configurations describe to review the output.
B . Use gcloud config configurations activate and gcloud config list to review the output.
C . Use kubectl config get-contexts to review the output.
D . Use kubectl config use-context and kubectl config view to review the output.

Answer: D

Explanation:

Reference: https://medium.com/google-cloud/kubernetes-engine-kubectl-config-b6270d2b656c

kubectl config view -o jsonpath='{.users[].name}’ # display the first user

kubectl config view -o jsonpath='{.users[*].name}’ # get a list of users

kubectl config get-contexts # display list of contexts

kubectl config current-context # display the current-context

kubectl config use-context my-cluster-name # set the default context to my-cluster-name

https://kubernetes.io/docs/reference/kubectl/cheatsheet/

Exit mobile version