<p>My Requirement is I have an app which will give <strong>5qps</strong> If end users say he wants 50qps it should deploy the same 10 times.</p>

<p>The issues I am facing are below.</p>

<p>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.</p>

<p>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.</p>

<p>I am trying kubernetes for the same but not sure how to achieve the same.</p>

<p>Any new suggestions are welcome.</p>

gokul kandasamy
<p>Use the <code>preferredDuringSchedulingIgnoredDuringExecution</code> kind of nodeselector to select your preferred node. <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#node-affinity" rel="nofollow noreferrer">Reference</a>.</p>

<p>To limit the number of pods running in the node to five use <a href="https://kubernetes.io/docs/tasks/administer-cluster/extended-resource-node/" rel="nofollow noreferrer">extended resources</a>.
Assign 5 of those resources to your preferred node.</p>

<p>Then modify the pod so it consume 1 of your new defined resources when is scheduled on a node. <a href="https://kubernetes.io/docs/tasks/configure-pod-container/extended-resource/" rel="nofollow noreferrer">Reference</a></p>

<p>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.  </p>
