Bird
Raised Fist0
Kubernetesdevops~20 mins

Node troubleshooting in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Node Troubleshooting Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Check node status with kubectl
You run the command kubectl get nodes on your cluster. What output indicates that a node is NotReady?
Kubernetes
kubectl get nodes
A
NAME       STATUS     ROLES    AGE   VERSION
node1      Ready      worker   10d   v1.26.0
node2      NotReady   worker   10d   v1.26.0
B
NAME       STATUS     ROLES    AGE   VERSION
node1      Ready      master   10d   v1.26.0
node2      Ready      worker   10d   v1.26.0
C
NAME       STATUS     ROLES    AGE   VERSION
node1      Unknown    worker   10d   v1.26.0
node2      Ready      worker   10d   v1.26.0
D
NAME       STATUS     ROLES    AGE   VERSION
node1      Ready      worker   10d   v1.26.0
node2      SchedulingDisabled   worker   10d   v1.26.0
Attempts:
2 left
💡 Hint
Look for the STATUS column showing node health.
Troubleshoot
intermediate
2:00remaining
Diagnose node unreachable error
You notice pods stuck in Pending state and suspect a node is unreachable. Which command helps you check node connectivity issues?
Akubectl logs <pod-name>
Bkubectl get pods --all-namespaces
Ckubectl exec <pod-name> -- ping 8.8.8.8
Dkubectl describe node <node-name>
Attempts:
2 left
💡 Hint
You want detailed info about the node itself.
Configuration
advanced
2:00remaining
Identify correct kubelet config for node readiness
Which kubelet configuration option ensures the node reports Ready status only when the node is healthy?
A--fail-swap-on=false
B--read-only-port=10255
C--eviction-hard=memory.available<500Mi,nodefs.available<10%
D--node-status-update-frequency=10s
Attempts:
2 left
💡 Hint
Look for settings that control node health eviction.
🔀 Workflow
advanced
3:00remaining
Sequence to safely drain a node
What is the correct order of commands to safely drain a node before maintenance?
A2,1,3,4
B1,2,3,4
C1,3,2,4
D4,1,2,3
Attempts:
2 left
💡 Hint
First prevent new pods, then move existing pods, then allow scheduling again.
Best Practice
expert
3:00remaining
Identify best practice for node failure alerting
Which approach is best to get immediate alerts when a Kubernetes node becomes NotReady?
ASet up Prometheus to monitor node status and alert on <code>NotReady</code> condition
BRestart kubelet service on all nodes daily
CUse <code>kubectl logs</code> on pods to check node health
DManually run <code>kubectl get nodes</code> every hour
Attempts:
2 left
💡 Hint
Automated monitoring and alerting is key for fast response.

Practice

(1/5)
1. What command shows the current status of all nodes in a Kubernetes cluster?
easy
A. kubectl get nodes
B. kubectl describe pods
C. kubectl get pods
D. kubectl top pods

Solution

  1. Step 1: Understand the command purpose

    kubectl get nodes lists all nodes and their status in the cluster.
  2. Step 2: Compare with other commands

    Other commands focus on pods, not nodes, so they don't show node status.
  3. Final Answer:

    kubectl get nodes -> Option A
  4. Quick Check:

    Node status = kubectl get nodes [OK]
Hint: Use 'kubectl get nodes' to see node status quickly [OK]
Common Mistakes:
  • Confusing pods with nodes
  • Using describe instead of get for quick status
  • Trying 'kubectl top pods' for node info
2. Which command syntax correctly shows detailed information about a specific node named node-1?
easy
A. kubectl describe node node-1
B. kubectl get node node-1
C. kubectl get nodes node-1
D. kubectl describe nodes node-1

Solution

  1. Step 1: Identify correct command for detailed info

    kubectl describe node node-1 shows detailed info about the node named node-1.
  2. Step 2: Check syntax correctness

    Singular 'node' is correct here; plural 'nodes' is invalid for describing a single node. 'get' shows summary, not details.
  3. Final Answer:

    kubectl describe node node-1 -> Option A
  4. Quick Check:

    Detailed node info = kubectl describe node [OK]
Hint: Use singular 'node' with describe for a specific node [OK]
Common Mistakes:
  • Using plural 'nodes' with describe for a single node
  • Using 'get' instead of 'describe' for details
  • Omitting the node name
3. What is the expected output of the command kubectl top node?
medium
A. A list of pods with their resource requests
B. A list of nodes with CPU and memory usage metrics
C. Detailed node configuration and labels
D. A list of nodes with their IP addresses only

Solution

  1. Step 1: Understand the purpose of 'kubectl top node'

    This command shows resource usage like CPU and memory for each node.
  2. Step 2: Differentiate from other outputs

    It does not show pod info, detailed config, or just IP addresses.
  3. Final Answer:

    A list of nodes with CPU and memory usage metrics -> Option B
  4. Quick Check:

    Resource usage per node = kubectl top node [OK]
Hint: Top command shows resource usage, not config or IPs [OK]
Common Mistakes:
  • Confusing node metrics with pod metrics
  • Expecting detailed config from 'top' command
  • Thinking it shows only IP addresses
4. You run kubectl describe node node-2 and see the node is in NotReady state. What is the best first step to troubleshoot?
medium
A. Run kubectl get pods to check pod status
B. Delete the node from the cluster immediately
C. Restart all pods on the node manually
D. Check the node's events section for errors or warnings

Solution

  1. Step 1: Review node events for clues

    The events section in the describe output shows recent errors or warnings causing NotReady state.
  2. Step 2: Avoid premature actions

    Deleting node or restarting pods without info can cause disruption; checking events is safer first step.
  3. Final Answer:

    Check the node's events section for errors or warnings -> Option D
  4. Quick Check:

    Check events first when node NotReady [OK]
Hint: Look at node events to find issues first [OK]
Common Mistakes:
  • Deleting node without diagnosis
  • Restarting pods blindly
  • Checking pods instead of node events first
5. A node shows high CPU usage and pods are evicted frequently. Which combined steps help troubleshoot and fix this?
hard
A. Scale down all deployments to zero immediately
B. Delete the node and recreate it to reset CPU usage
C. Use kubectl top node to confirm CPU load, then check pod resource requests and limits
D. Run kubectl describe pod on all pods to find errors

Solution

  1. Step 1: Confirm node CPU usage

    Run kubectl top node to verify high CPU load on the node.
  2. Step 2: Check pod resource settings

    Review pods' resource requests and limits to see if they are causing CPU overload and evictions.
  3. Step 3: Adjust resources or scale pods

    Based on findings, adjust pod resource limits or scale workloads to reduce CPU pressure.
  4. Final Answer:

    Use kubectl top node to confirm CPU load, then check pod resource requests and limits -> Option C
  5. Quick Check:

    Check CPU usage and pod limits to fix evictions [OK]
Hint: Check node CPU then pod limits to fix evictions [OK]
Common Mistakes:
  • Deleting node without analysis
  • Scaling down all deployments blindly
  • Checking pods errors without resource context