Home > Net >  Force pod creation order
Force pod creation order

Time:04-23

Is there some way to force pod creation order on Kubernetes?

I have a scenario where Kubernetes are selecting a node pool with few resources and the first pod to be deployed consume a very small resource, but the next one consumes a lot of resources and the deployment fails.

So I was wondering if there is a way to instruct Kubernetes to deploy first the pod that is resource hog then the small ones

CodePudding user response:

You can use Node Selector on your Pod’s specification, you just need Node Labels for that.

Another option is to use Node Affinity. You just need to have the Kubernetes cluster, and the K8s command line ready (kubectl). The steps for that are:

  • Add a label to the node.
  • Schedule a Pod using required node affinity, or.
  • Schedule a Pod using preferred node affinity.

Visit the official documentation I shared with you some lines above to have the detailed instructions, manifest examples, and the following URL for official K8’s documentation about Assigning Pods to Nodes.

Plus, you can also set up the Pod initialization in a specific order. See this thread for the proper instructions.

  • Related