Openshift-dns daemonsets doesn't include toleration to run on nodes with taints
Environment
- Red Hat OpenShift Container Platform (RHOCP)
- 4
Issue
-
Openshift-dns daemonsetdoesn't includetolerationto run on nodes withtaints. After aNoSchedule taintis configured for a node, thedaemon setstops managing the pods on that node and 2 things happen:- If the pods are deleted on nodes with
taint, they won't be recovered. no dns-default pod found for nodeis reported.- The following alerts are triggering:
Pods of `DaemonSet openshift-dns/dns-default` are running where they are not supposed to run. - If the pods are deleted on nodes with
Resolution
- Add the below
tolerationby editing thednsoperator as below - NOTE: By adding such toleration all Pods from all nodes will get a restart. This is a harmless operation. If unsure, please raise a case by following the How do I open and manage a support case on the Customer Portal? article.
$ oc edit dns.operator/default
apiVersion: operator.openshift.io/v1
kind: DNS
metadata:
name: default
spec:
nodePlacement:
tolerations:
- operator: Exists
- Another way is to delete the dns-default Pod on the Node when configured not to run the DNS Pod on the node where the taint is configured.
Diagnostic Steps
-
Check desired nodes for the
dnsdeamonsets:$ oc -n openshift-dns get ds NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE dns-default 5 5 5 5 5 kubernetes.io/os=linux 5d3h -
Apply
NoSchedule taintto node:$ oc adm taint nodes worker-1 node-role.kubernetes.io/infra:NoSchedule node/worker-1 tainted $ oc adm taint nodes worker-2 node-role.kubernetes.io/infra:NoSchedule node/worker-2 tainted -
Check that the desired count has less than the number of nodes:
$ oc -n openshift-dns get ds NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE dns-default 3 3 3 3 3 kubernetes.io/os=linux 5d3h -
This error is displayed in the OpenShift console:
Pods of DaemonSet openshift-dns/dns-default are running where they are not supposed to run
SBR
Product(s)
Category
Tags
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.