My Requirement is I have an app which will give 5qps If end users say he wants 50qps it should deploy the same 10 times.
The issues I am facing are below.
How to use kubernetes to take how many pods are deployed on a server and depending on it it should deploy in the same or another server.
For eg: If a server can handle only 5 pods and there are 2 pods there already then it should deploy 3 pods in the same server and deploy the remaining 2 pods in another server.
I am trying kubernetes for the same but not sure how to achieve the same.
Any new suggestions are welcome.
You have to use NodeSelector to ensure you deploy on the right node with the resources you need.
Use the preferredDuringSchedulingIgnoredDuringExecution
kind of nodeselector to select your preferred node. Reference.
To limit the number of pods running in the node to five use extended resources. Assign 5 of those resources to your preferred node.
Then modify the pod so it consume 1 of your new defined resources when is scheduled on a node. Reference
Your special pods will only be scheduled on nodes that have those kinds of resources and in numbers equal to the amount of resource the node has, so take care to assign that resource to the other nodes where your pod should be deployed.