can configmaps use tolerations in kubernetes?

6/4/2019

kubernetes documentation can be a lot better but as with a very bulky software documentation becomes a big issue to deal with

i am trying to deploy configmap using kubectl and i am yet to find any documentation to explains if i can use tolerations or not with configmaps

i assume if i want to deploy an app that will use configmap, i should deploy in exact nodes i want so all things related to the app stays on same nodes...so following that i will assume configmap should allow tolerations as well

but upon trying to add tolerations so i can target specific nodes, here is what i get

...
unknown field "tolerations" in io.k8s.api.core.v1.ConfigMap
...
-- uberrebu
configmap
kubectl
kubernetes

1 Answer

6/4/2019

wherever the pod get schedule, configMap will be there on that node, its the responsibility of kubelet to bring it on the node from the etcd and mount it inside the container(pod), so it does not make sense to put toleration on configMap object.

  • Taint is applied to nodes, and toleration is applied to the 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.

  • With the configMap, you have an independent lifecycle of configuration data. it is not baked into the container, which is a flexible solution.

  • Get documentation of various resources and their field with the following command

    kubectl explain $K8sObject --recursive

taint-and-toleration-Concept

-- Suresh Vishnoi
Source: StackOverflow