Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Appendix C. Applying labels and taints to Red Hat OpenShift node
In order to have our control pods run on a dedicated Red Hat OpenShift node, one must set the appropriate labels and taints to the specified node.
In this example, we will select one of our Red Hat OpenShift nodes with the role worker the label aap_node_type=control.
Get the name of one of the nodes you want to label running
oc get nodes
$ oc get nodesCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Choose a node from the list and note its name, e.g.
worker1 Apply the
aap_node_type=controllabel to the nodeoc label node <node-name> aap_node_type=control
$ oc label node <node-name> aap_node_type=controlCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteReplace
<node-name>with the name of the node you want to label.Verify the creation of the label as follows:
oc get nodes --show-labels | grep <node-name>
$ oc get nodes --show-labels | grep <node-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow With the label created, the next step is to add a
NoScheduletaint to the worker node we have already created a label for.The following command adds a
NoScheduletaint to our node:oc adm taint nodes <node-name> dedicated=AutomationController:NoSchedule
oc adm taint nodes <node-name> dedicated=AutomationController:NoScheduleCopy to Clipboard Copied! Toggle word wrap Toggle overflow dedicated: This is the key of the taint that is an arbitrary string supplied that identifies the taint.AutomationController: This is an arbitrary value given to the taint.NoSchedule: This is the effect of the taint which specifies no pods that don’t tolerate this taint will be scheduled onto this node.By applying this taint to our node, we are telling the Kubernetes scheduler to reserve this node for certain types of workloads that tolerate the taint. In this case, we are reserving the node for workloads with the dedicated=AutomationController toleration.
Verify the taint has been applied
oc get nodes \ -o jsonpath='{range.items[*]}{@.metadata.name}{"\t"}{@.spec.taints[*].key}:{@.spec.taints[*].value}{"\n"}{end}' \ | grep AutomationController$ oc get nodes \ -o jsonpath='{range.items[*]}{@.metadata.name}{"\t"}{@.spec.taints[*].key}:{@.spec.taints[*].value}{"\n"}{end}' \ | grep AutomationControllerCopy to Clipboard Copied! Toggle word wrap Toggle overflow