0
0
Azurecloud~20 mins

Kubectl for cluster management in Azure - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kubectl Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What is the output of this kubectl command?
You run kubectl get pods --namespace=default in your Azure Kubernetes cluster. What will this command display?
AA list of all nodes in the cluster with their IP addresses.
BA list of all pods running in the default namespace with their status and age.
CThe detailed configuration of the default namespace.
DThe logs of the most recently created pod in the default namespace.
Attempts:
2 left
💡 Hint
Think about what 'get pods' and 'namespace' mean in kubectl commands.
Configuration
intermediate
2:00remaining
Which kubectl command correctly scales a deployment?
You want to scale the deployment named webapp to 5 replicas in your Azure Kubernetes cluster. Which command will do this?
Akubectl scale deployment webapp --replicas=5
Bkubectl set replicas webapp 5
Ckubectl update deployment webapp replicas 5
Dkubectl deploy scale webapp 5
Attempts:
2 left
💡 Hint
Look for the standard kubectl subcommand to change replicas.
security
advanced
2:00remaining
What error occurs when running kubectl without proper cluster credentials?
You run kubectl get pods but your kubeconfig file is missing or invalid. What error message will you most likely see?
Aerror: You must be logged in to the server (Unauthorized)
Berror: resource not found
Cerror: invalid command syntax
Derror: pod not ready
Attempts:
2 left
💡 Hint
Think about authentication errors when credentials are missing.
Architecture
advanced
2:00remaining
Which kubectl command shows the node where a pod is running?
You want to find out on which node the pod named backend-xyz is running. Which command will give you this information?
Akubectl get nodes backend-xyz
Bkubectl describe node backend-xyz
Ckubectl get pod backend-xyz -o wide
Dkubectl logs backend-xyz
Attempts:
2 left
💡 Hint
Look for a command that shows detailed pod info including node name.
Best Practice
expert
3:00remaining
What is the recommended way to update a deployment image without downtime?
You want to update the container image of deployment api-server to api:v2 in your Azure Kubernetes cluster. Which kubectl command follows best practices to avoid downtime?
Akubectl delete deployment api-server && kubectl create deployment api-server --image=api:v2
Bkubectl scale deployment api-server --replicas=0; kubectl set image deployment/api-server api=api:v2; kubectl scale deployment api-server --replicas=3
Ckubectl edit deployment api-server and manually change the image field
Dkubectl set image deployment/api-server api=api:v2
Attempts:
2 left
💡 Hint
Consider commands that update images with rolling updates.