0
0
GCPcloud~20 mins

Kubectl configuration for GKE in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
GKE Kubectl Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Configuration
intermediate
2:00remaining
Understanding the kubectl context after GKE cluster creation

After creating a new GKE cluster, you run kubectl config get-contexts. What does the output show?

AAn error saying no contexts are configured yet
BOnly the new GKE cluster context without any other contexts
CA list of all Kubernetes contexts including the new GKE cluster context with its cluster and user info
DA list of all pods running in the default namespace
Attempts:
2 left
💡 Hint

Think about what kubectl config get-contexts shows in general.

service_behavior
intermediate
2:00remaining
Effect of running 'gcloud container clusters get-credentials' on kubectl

What happens when you run gcloud container clusters get-credentials my-cluster --zone us-central1-a --project my-project?

AIt updates your kubeconfig file to add credentials and context for the specified GKE cluster
BIt creates a new GKE cluster named 'my-cluster' in the specified zone
CIt deletes the kubeconfig file and resets kubectl configuration
DIt lists all running pods in the 'my-cluster' cluster
Attempts:
2 left
💡 Hint

Consider what the command name suggests about credentials and configuration.

security
advanced
2:00remaining
Identifying security risks in kubeconfig file sharing

You share your kubeconfig file with a colleague. What is a potential security risk of this action?

AThe colleague can access your GKE cluster with your permissions, possibly causing unintended changes
BThe kubeconfig file will automatically expire and become unusable after 24 hours
CSharing kubeconfig files is safe because they contain only public information
DThe colleague can only view cluster metadata but cannot make changes
Attempts:
2 left
💡 Hint

Think about what credentials and permissions kubeconfig files hold.

Architecture
advanced
2:00remaining
How kubectl communicates with a GKE cluster

Which component does kubectl communicate with directly to manage resources in a GKE cluster?

AThe Google Cloud Storage bucket linked to the cluster
BThe Google Cloud Console web interface
CThe GKE master node's operating system shell
DThe Kubernetes API server running inside the GKE cluster
Attempts:
2 left
💡 Hint

Consider what kubectl commands like kubectl get pods interact with.

Best Practice
expert
2:00remaining
Best practice for managing multiple GKE cluster contexts in kubectl

You manage multiple GKE clusters across projects and regions. What is the best practice to avoid confusion when switching between clusters using kubectl?

AManually edit the kubeconfig file to remove unused clusters each time
BUse descriptive context names and switch contexts explicitly with <code>kubectl config use-context</code>
CDelete all other contexts except the one you are currently using
DAlways run <code>gcloud container clusters get-credentials</code> before every kubectl command
Attempts:
2 left
💡 Hint

Think about how kubectl manages multiple cluster connections.