0
0
Azurecloud~10 mins

Kubectl for cluster management in Azure - Interactive Code Practice

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

Complete the command to list all pods in the current Kubernetes cluster.

Azure
kubectl [1] pods
Drag options to blanks, or click blank then click option'
Acreate
Bget
Cdelete
Dapply
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' instead of 'get' will try to create a resource.
Using 'delete' will remove resources, not list them.
2fill in blank
medium

Complete the command to switch the current context to a cluster named 'prod-cluster'.

Azure
kubectl config [1] prod-cluster
Drag options to blanks, or click blank then click option'
Adelete-context
Bset-context
Cuse-context
Dget-contexts
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'set-context' modifies context settings but does not switch the active context.
Using 'get-contexts' only lists available contexts.
3fill in blank
hard

Fix the error in the command to delete a pod named 'web-server'.

Azure
kubectl [1] pod web-server
Drag options to blanks, or click blank then click option'
Aremove
Bdestroy
Cterminate
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' or 'destroy' causes command errors because they are not kubectl verbs.
Forgetting to specify the resource type 'pod' can cause errors.
4fill in blank
hard

Fill both blanks to describe the command that shows detailed information about a pod named 'db-server'.

Azure
kubectl [1] pod [2] -o yaml
Drag options to blanks, or click blank then click option'
Adescribe
Bdb-server
Cget
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'get' instead of 'describe' shows less detail.
Using 'list' is not a valid kubectl command.
5fill in blank
hard

Fill all three blanks to create a deployment named 'frontend' using the image 'nginx:latest' with 3 replicas.

Azure
kubectl create deployment [1] --image=[2] --replicas=[3]
Drag options to blanks, or click blank then click option'
Afrontend
Bnginx:latest
C3
Dbackend
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'backend' instead of 'frontend' changes the deployment name.
Forgetting to specify the number of replicas defaults to 1.