configmaps 可以在 kubernetes 中使用容忍度吗?

can configmaps use tolerations in kubernetes?

kubernetes 文档可能会好很多,但是由于非常庞大的软件文档成为一个需要处理的大问题

我正在尝试使用 kubectl 部署 configmap,但我还没有找到任何文档来解释我是否可以使用 configmaps 的容忍度

我假设如果我想部署一个将使用 configmap 的应用程序,我应该部署在我想要的确切节点上,这样与应用程序相关的所有东西都保持在相同的节点上......所以接下来我将假设 configmap 应该允许容忍度也

但是在尝试添加容忍度以便我可以针对特定节点时,这就是我得到的结果

...
unknown field "tolerations" in io.k8s.api.core.v1.ConfigMap
...

无论 pod 在何处获得调度,configMap 都会在该节点上,kubelet 有责任将其从 etcd 并将其挂载到容器 (pod) 中,因此对 configMap 对象施加容忍是没有意义的。

  • 污点应用于节点,容忍应用于 pod。

taints and tolerations work together to ensure that pods are not scheduled onto inappropriate nodes. One or more taints are applied to a node; this marks that the node should not accept any pods that do not tolerate the taints. Tolerations are applied to pods, and allow (but do not require) the pods to schedule onto nodes with matching taints.

  • 有了configMap,你就有了一个独立的配置数据生命周期。不烘烤到容器中,这是一种灵活的解决方案。

  • 使用以下命令获取各种资源及其领域的文档

    kubectl explain $K8sObject --recursive

taint-and-toleration-Concept