What is the main reason to set CPU and memory limits on containers in Kubernetes?
Think about what happens if one container uses too much CPU or memory.
Setting resource limits prevents a container from consuming excessive CPU or memory, which can cause other containers or the node to become unstable or crash.
What is the output of the command kubectl top pod in a Kubernetes cluster?
kubectl top podThink about what 'top' means in Linux commands.
The kubectl top pod command shows the current CPU and memory usage of each pod, helping monitor resource consumption.
Put the steps in the correct order to prevent resource starvation by managing pod resources properly.
Think about defining limits first, then checking usage, then adjusting and redeploying.
First, define resource requests and limits. Then monitor usage to see if adjustments are needed. Next, update limits accordingly. Finally, redeploy pods with new settings.
A pod in your Kubernetes cluster was evicted with the message 'The node was low on resource: memory'. What is the most likely cause?
Eviction due to low resource usually relates to memory or CPU pressure on the node.
When a node runs low on memory, Kubernetes evicts pods that use more memory than their limits to free resources and keep the node stable.
Which practice helps ensure efficient resource use and cluster stability in Kubernetes?
Think about how Kubernetes schedules pods and manages resources.
Setting requests equal to limits helps Kubernetes schedule pods reliably and prevents resource overcommitment that can cause instability.