0
0
Kubernetesdevops~10 mins

kubectl logs for debugging in Kubernetes - Interactive Code Practice

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

Complete the command to show logs of a pod named 'webapp'.

Kubernetes
kubectl logs [1]
Drag options to blanks, or click blank then click option'
Aget pods
Bwebapp
Cdelete pod
Ddescribe pod
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'get pods' instead of the pod name.
Using 'describe pod' which shows details, not logs.
2fill in blank
medium

Complete the command to follow logs of the pod 'backend' in real-time.

Kubernetes
kubectl logs -f [1]
Drag options to blanks, or click blank then click option'
Adatabase
Bfrontend
Cbackend
Dcache
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong pod name.
Forgetting the -f flag to follow logs.
3fill in blank
hard

Fix the error in the command to get logs from the container 'api' inside pod 'service'.

Kubernetes
kubectl logs [1] -c api
Drag options to blanks, or click blank then click option'
Apod
Bapi
Ccontainer
Dservice
Attempts:
3 left
💡 Hint
Common Mistakes
Using container name instead of pod name.
Placing container name before pod name.
4fill in blank
hard

Fill both blanks to get logs from the previous instance of pod 'worker' container 'job'.

Kubernetes
kubectl logs [1] -c [2] --previous
Drag options to blanks, or click blank then click option'
Aworker
Bjob
Cservice
Dapi
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing pod and container names.
Forgetting the --previous flag.
5fill in blank
hard

Fill all three blanks to get logs from all containers in pod 'app' and follow them live.

Kubernetes
kubectl logs [1] [2] [3]
Drag options to blanks, or click blank then click option'
A-f
B-l
C--all-containers=true
Dapp
Attempts:
3 left
💡 Hint
Common Mistakes
Missing the --all-containers=true flag.
Wrong order of flags.