Can you tell kubernetes to start one pod before another?

[亡魂溺海] 提交于 2021-01-27 20:33:36

问题


Can I add some config so that my daemon pods start before other pods can be scheduled or nodes are designated as ready?

Adding post edit:

These are 2 different pods altogether, the daemonset is a downstream dependency to any pods that might get scheduled on the host.


回答1:


There's no such a thing as Pod hierarchy in Kubernetes between multiple separate types of pods. Meaning belonging to different Deployments, Statefulsets, Daemonsets, etc. In other words, there is no notion of a master pod and children pods. If you like to create your custom hierarchy you can build your own tooling around, for example waiting for the status of all pods in a DaemonSet to start or create a new Pod or Kubernetes workload resource.

The closest in terms of pod dependency in K8s is StatefulSets.

As per the docs:

For a StatefulSet with N replicas, when Pods are being deployed, they are created sequentially, in order from {0..N-1}.



来源:https://stackoverflow.com/questions/53345517/can-you-tell-kubernetes-to-start-one-pod-before-another

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!