0
0
Kubernetesdevops~20 mins

Resource monitoring best practices in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Resource Monitoring Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Kubernetes Resource Requests and Limits

In Kubernetes, what is the primary purpose of setting resource requests and limits for containers?

ATo define the exact amount of CPU and memory a container must always use during its lifetime.
BTo allow containers to use unlimited resources without restrictions.
CTo specify the minimum and maximum CPU and memory a container can use, helping the scheduler place pods and prevent resource overuse.
DTo automatically scale the number of pods based on resource usage.
Attempts:
2 left
💡 Hint

Think about how Kubernetes decides where to put pods and how it avoids one pod using too much resource.

💻 Command Output
intermediate
2:00remaining
Interpreting kubectl top pod Output

What is the output of the following command if the pod web-server-1 is using 150m CPU and 200Mi memory?

kubectl top pod web-server-1
A
NAME           CPU(cores)   MEMORY(bytes)
web-server-1   150m         200Mi
Bweb-server-1 150 200
C
NAME           CPU(cores)   MEMORY(bytes)
web-server-1   0.15         0.2
DError: pod web-server-1 not found
Attempts:
2 left
💡 Hint

Look at the units kubectl top uses for CPU and memory.

🔀 Workflow
advanced
3:00remaining
Setting Up Prometheus for Kubernetes Monitoring

Which sequence of steps correctly describes setting up Prometheus to monitor Kubernetes cluster metrics?

A1,2,3,4
B1,3,2,4
C2,1,3,4
D1,2,4,3
Attempts:
2 left
💡 Hint

Think about deploying the operator first, then defining what to monitor, then configuring Prometheus, and finally viewing metrics.

Troubleshoot
advanced
2:00remaining
Troubleshooting Missing Metrics in Kubernetes Monitoring

You installed Prometheus in your Kubernetes cluster, but no metrics appear for your application pods. Which is the most likely cause?

AThe Prometheus Operator is running but Prometheus is not installed.
BThe ServiceMonitor resource is missing or incorrectly configured for the application pods.
CThe Kubernetes API server is down.
DThe application pods are using too much CPU and memory.
Attempts:
2 left
💡 Hint

Think about how Prometheus knows which pods to monitor.

Best Practice
expert
2:30remaining
Best Practice for Alerting on Resource Usage in Kubernetes

What is the best practice for setting alerts on CPU and memory usage in a Kubernetes cluster to avoid false alarms?

ASet alerts only on maximum resource limits defined in pod specs.
BSet very low thresholds to catch any small increase in resource usage immediately.
CDisable alerts and rely on manual checks to avoid false alarms.
DSet alert thresholds based on historical usage patterns and include a duration to avoid firing alerts on short spikes.
Attempts:
2 left
💡 Hint

Think about how to balance alert sensitivity and noise.