0
0
GCPcloud~10 mins

GKE monitoring and logging 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 enable monitoring on a GKE cluster.

GCP
gcloud container clusters create my-cluster --enable-[1]
Drag options to blanks, or click blank then click option'
Astackdriver-kubernetes
Bautoscaling
Clogging
Dnetwork-policy
Attempts:
3 left
💡 Hint
Common Mistakes
Using --enable-logging alone does not enable full monitoring integration.
Confusing autoscaling with monitoring features.
2fill in blank
medium

Complete the command to view logs of a pod named 'web-server' in namespace 'default'.

GCP
kubectl logs [1] -n default
Drag options to blanks, or click blank then click option'
Adeployment/web-server
Bpod/web-server
Cweb-server
Dservice/web-server
Attempts:
3 left
💡 Hint
Common Mistakes
Using deployment or service names instead of pod name.
Omitting the namespace when the pod is not in default namespace.
3fill in blank
hard

Fix the error in the command to enable logging on an existing cluster named 'prod-cluster'.

GCP
gcloud container clusters update prod-cluster --[1]-logging
Drag options to blanks, or click blank then click option'
Aenable
Bdisable
Cstart
Dactivate
Attempts:
3 left
💡 Hint
Common Mistakes
Using --start-logging or --activate-logging which are invalid flags.
Using --disable-logging when intending to enable.
4fill in blank
hard

Fill both blanks to create a monitoring workspace and link it to a GKE cluster.

GCP
gcloud monitoring workspaces [1] --project=[2]
Drag options to blanks, or click blank then click option'
Acreate
Bdelete
Cmy-gke-project
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'delete' or 'list' instead of 'create' for the workspace.
Not specifying the correct project ID.
5fill in blank
hard

Fill all three blanks to filter logs for pods with label 'app=frontend' in Stackdriver Logging.

GCP
resource.type="k8s_container" AND labels.k8s-pod/app=[1] AND resource.labels.namespace_name=[2] AND severity [3] "ERROR"
Drag options to blanks, or click blank then click option'
A"frontend"
B"default"
C>=
D"backend"
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong label values or namespaces.
Using incorrect severity operators like '=' instead of '>='.