gpt4 book ai didi

存在容忍度的 Kubernetes DaemonSets

转载 作者:行者123 更新时间:2023-12-02 11:56:55 25 4
gpt4 key购买 nike

我正在考虑将我的 Kubernetes 集群划分为专用节点区域,供专用用户组独占使用,如所讨论的 here .我想知道污染节点将如何影响 DaemonSets,包括那些对集群操作至关重要的节点(例如 kube-proxykube-flannel-ds-amd64)?

documentation说 daemon pod 尊重污点和容忍度。但如果是这样,系统如何安排,例如kube-proxy 节点上的 pod 被 kubectl taint nodes node-x zone=zone-y:NoSchedule 当 pod(不在我的控制之下但归 Kubernetes 自己的 DaemonSet kube- proxy) 不带有相应的容忍度。

到目前为止,我凭经验发现 Kubernetes 1.14 会重新安排 kube-proxy pod(在我在受污染的 node-x 上删除它之后),这似乎与文档相矛盾。另一方面,我自己的 DaemonSet 似乎不是这种情况。当我在 node-x 上杀死它的 pod 时,它只会在我删除节点的污点后重新安排(或者可能是在我向 DaemonSet 中的 pod 规范添加容忍之后)。

那么 DaemonSet 和 tolerations 如何进行详细的互操作。会不会是某些DaemonSet(比如kube-proxykube-flannel-ds-amd64)被特殊处理了?

最佳答案

您的 kube-proxy 和 flannel daemonsets 将在其 list 中定义许多容忍度,这意味着即使在受污染的节点上它们也会被调度。

这是我的 canal daemonset 中的一对:

tolerations:
- effect: NoSchedule
operator: Exists
- key: CriticalAddonsOnly
operator: Exists
- effect: NoExecute
operator: Exists

这是我的一个主节点的污点:

taints:
- effect: NoSchedule
key: node-role.kubernetes.io/controlplane
value: "true"
- effect: NoExecute
key: node-role.kubernetes.io/etcd
value: "true"

尽管由于其 NoScheduleNoExectue 污点,大多数工作负载不会被安排在 master 上,但一个 canal pod 将在那里运行,因为 daemonset 专门容忍这些污点。

doc you already linked to详细介绍。

关于存在容忍度的 Kubernetes DaemonSets,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57006394/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com