Hi everyone,
I’m running a Kubernetes cluster on DigitalOcean, and I’m facing an issue where my pods are stuck in the “Pending” state and won’t start. This happened after I scaled my application to add more replicas.
Here’s my setup:
What I’ve observed:
kubectl describe pod <pod-name>
shows the following events:Warning FailedScheduling 30s (x3 over 1m) default-scheduler 0/3 nodes are available: insufficient memory.
What I’ve tried so far:
Questions I have:
Any advice or suggestions would be greatly appreciated! Thanks in advance for your help.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi Ben,
The error
0/3 nodes are available: insufficient memory
points to the fact that Kubernetes cannot find enough available memory/RAM to schedule the new pods.As you’ve mentioned, your nodes each have 4 GB of RAM, and if existing pods are using around 80% of that, adding more replicas will struggle to fit within the remaining memory. To confirm this, run:
This will give you a snapshot of current memory usage per node. If nodes are consistently near their memory limits, consider resizing your nodes to instances with more RAM (e.g., 4 vCPUs and 8 GB RAM) to handle the additional load.
Since each pod requests 500Mi of memory, that adds up quickly. If your Deployment’s
requests
andlimits
are too high, Kubernetes will not schedule pods even if some memory is available. If possible, you could consider lowering resource requests or limits temporarily to see if pods can be scheduled. For example:You can also check if any pods are consuming more memory than expected. Use:
If you notice pods consuming excessive memory, investigate if optimizations or adjustments are possible. For instance, some processes may need fine-tuning, or there might be unnecessary workloads running.
On another note, if your workloads vary significantly depending on the time of the day and the demand of your users, enabling Kubernetes Node Autoscaling can help automatically add nodes when resources are insufficient. DigitalOcean Kubernetes supports this feature:
How to Enable Autoscaling on DigitalOcean Kubernetes
Let me know how it goes!
– Bobby