If you have an infra node that has the infra
and worker
roles assigned, you must configure the node so that user workloads are not assigned to it.
Important
|
It is recommended that you preserve the dual |
-
Configure additional
MachineSet
objects in your {product-title} cluster.
-
Add a taint to the infra node to prevent scheduling user workloads on it:
-
Determine if the node has the taint:
$ oc describe nodes <node_name>
Sample outputoc describe node ci-ln-iyhx092-f76d1-nvdfm-worker-b-wln2l Name: ci-ln-iyhx092-f76d1-nvdfm-worker-b-wln2l Roles: worker ... Taints: node-role.kubernetes.io/infra:NoSchedule ...
This example shows that the node has a taint. You can proceed with adding a toleration to your pod in the next step.
-
If you have not configured a taint to prevent scheduling user workloads on it:
$ oc adm taint nodes <node_name> <key>:<effect>
For example:
$ oc adm taint nodes node1 node-role.kubernetes.io/infra:NoSchedule
TipYou can alternatively apply the following YAML to add the taint:
kind: Node apiVersion: v1 metadata: name: <node_name> labels: ... spec: taints: - key: node-role.kubernetes.io/infra effect: NoSchedule ...
This example places a taint on
node1
that has keynode-role.kubernetes.io/infra
and taint effectNoSchedule
. Nodes with theNoSchedule
effect schedule only pods that tolerate the taint, but allow existing pods to remain scheduled on the node.NoteIf a descheduler is used, pods violating node taints could be evicted from the cluster.
-
-
Add tolerations for the pod configurations you want to schedule on the infra node, like router, registry, and monitoring workloads. Add the following code to the
Pod
object specification:tolerations: - effect: NoSchedule (1) key: node-role.kubernetes.io/infra (2) operator: Exists (3)
-
Specify the effect that you added to the node.
-
Specify the key that you added to the node.
-
Specify the
Exists
Operator to require a taint with the keynode-role.kubernetes.io/infra
to be present on the node.This toleration matches the taint created by the
oc adm taint
command. A pod with this toleration can be scheduled onto the infra node.NoteMoving pods for an Operator installed via OLM to an infra node is not always possible. The capability to move Operator pods depends on the configuration of each Operator.
-
-
Schedule the pod to the infra node using a scheduler. See the documentation for Controlling pod placement onto nodes for details.