0
0
GCPcloud~10 mins

Kubectl configuration for GKE in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to get credentials for your GKE cluster.

GCP
gcloud container clusters get-credentials [1] --zone us-central1-a --project my-project
Drag options to blanks, or click blank then click option'
Amy-cluster
Bmy-zone
Cmy-project
Dmy-node
Attempts:
3 left
💡 Hint
Common Mistakes
Using the project name instead of the cluster name.
Using the zone name instead of the cluster name.
2fill in blank
medium

Complete the kubectl command to list all pods in the default namespace.

GCP
kubectl [1] pods
Drag options to blanks, or click blank then click option'
Aget
Bcreate
Cdelete
Ddescribe
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' instead of 'get'.
Using 'delete' which removes resources.
3fill in blank
hard

Fix the error in the kubectl command to switch context to your GKE cluster.

GCP
kubectl config use-context [1]
Drag options to blanks, or click blank then click option'
Aus-central1-a
Bmy-cluster
Cdefault
Dgke_my-project_us-central1-a_my-cluster
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the cluster name instead of full context.
Using the zone or default as context.
4fill in blank
hard

Fill both blanks to set the current context namespace to 'development'.

GCP
kubectl config set-context [1] --namespace=[2]
Drag options to blanks, or click blank then click option'
A--current
Bdefault
Cdevelopment
Dproduction
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'default' instead of '--current' for context.
Setting namespace to 'production' instead of 'development'.
5fill in blank
hard

Fill all three blanks to create a kubeconfig file for a GKE cluster with authentication.

GCP
gcloud container clusters get-credentials [1] --zone [2] --project [3]
Drag options to blanks, or click blank then click option'
Amy-cluster
Bus-central1-a
Cmy-project
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up project and zone values.
Using 'default' instead of actual cluster or project names.