-1

For eg: worker node(W) have 64GB of memory and 16vCPUs

resources assigned to a pod : cpu - 4 , memory- 8GB

Now only 4 pods can be scheduled on worker node(W).

How can i achieve this ?

Node affinity , node selectors or taint and tolerations do not work in this case.

New contributor
Swetank Rawat is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1

0

Use a custom scheduler or a scheduler extender. First, ensure the Kubernetes Metrics Server is running to collect real-time memory data from the nodes. Then, either modify the default scheduler / create a custom one that checks the node’s memory usage before placing new pods. If the memory usage is over 50%, the scheduler should block new pods from being scheduled, even if there are still available resources based on the pod's requests. Also set up Prometheus to monitor memory usage and trigger alerts or actions when a node hits the threshold, preventing new pod placements. This approach should ig.

New contributor
Kiyomizu is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.