如何在 Kubernetes 中的一个节点上仅允许一个类型的 pod。守护进程集不适合此用例。
例如- 限制一个节点上仅调度一个 Elasticsearch pod,以防止节点出现故障时数据丢失。
可以通过仔细规划Pod的CPU/内存资源和集群的机器类型来实现。
还有其他方法吗?
Kubernetes 1.4 推出Inter-pod affinity and anti-affinity
。来自文档 https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature: Inter-pod affinity and anti-affinity allow you to constrain which nodes your pod is eligible to schedule on based on labels on pods that are already running on the node
.
这不会阻止 pod 被调度到节点上,但至少当且仅当调度程序别无选择时,pod 才会被调度到节点上。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)