<p>For some application，start or restart need more resources than running。for exapmle：es/flink。if a node have network jitter，all pods would restart at the same time in this node。When this happens，cpu usage becomes very high in this node。it would increase resource competition in this node。</p>
<p>now i want to start pods in batches for only one node。how to realize the function now？</p>

<p>Kubernetes have auto-healing</p>
<p>You can let the POD crash and Kubernetes will auto re-start them soon as get the sufficient memory or resource requirement</p>
<p>Or else if you want to put the wait somehow so that deployment wait and gradually start one by one</p>
<p>you can use the sidecar and use the POD lifecycle hooks to start the main container, this process is not best but can resolve your issue.</p>
<p>Basic example :</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: sidecar-starts-first
spec:
  containers:
  - name: sidecar
    image: my-sidecar
    lifecycle:
      postStart:
        exec:
          command:
          - /bin/wait-until-ready.sh
  - name: application
    image: my-application
</code></pre>
<p><a href="https://i.stack.imgur.com/PtREE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PtREE.png" alt="enter image description here" /></a></p>
<p><strong>OR</strong></p>
<p>You can also use the <strong>Init container</strong> to check the other container's health and start the main container POD once one POD is of another service.</p>
<p><a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" rel="nofollow noreferrer">Init container</a></p>
<p>i would also recommend to check the Priority class : <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/</a></p>
