Kubernetes StatefulSets - 运行 每个工作节点上的 pod

Kubernetes StatefulSets - run pod on every worker node

将每个可用工作节点上的单个 Pod 作为 StatefulSet 的一部分 运行 的最简单方法是什么。所以,一对一映射。

我说每个 Pod 都会 运行 默认情况下使用 StatefulSet 在不同的节点上吗?在什么情况下,将x pods 添加到集群中存在x 个Worker 节点的SS 就足够了?

谢谢。

改用DaemonSet

A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are garbage collected. Deleting a DaemonSet will clean up the Pods it created.

如果你真的想使用statefulSet,你可以看看像nodeSelector or Affinity and Anti-affinity这样的功能。