You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* See xref:../nodes/scheduling/nodes-scheduler-about.adoc#nodes-scheduler-about[Controlling pod placement using the scheduler] for general information on scheduling a pod to a node.
99
99
* See xref:moving-resources-to-infrastructure-machinesets[Moving resources to infrastructure machine sets] for instructions on scheduling pods to infra nodes.
100
+
* See xref:../nodes/scheduling/nodes-scheduler-taints-tolerations.adoc#nodes-scheduler-taints-tolerations-about_nodes-scheduler-taints-tolerations[Understanding taints and tolerations] for more details about different effects of taints.
This example places a taint on `node1` that has key `node-role.kubernetes.io/infra` and taint effect `NoSchedule`. Nodes with the `NoSchedule` effect schedule only pods that tolerate the taint, but allow existing pods to remain scheduled on the node.
80
+
This example places a taint on `node1` that has key `node-role.kubernetes.io/infra` and taint effect `NoSchedule`. Nodes with the `NoSchedule` effect schedule only pods that tolerate the taint, but allow existing pods to remain scheduled on the node.
81
81
+
82
82
[NOTE]
83
83
====
84
84
If a descheduler is used, pods violating node taints could be evicted from the cluster.
85
85
====
86
86
87
+
.. Add the taint with NoExecute Effect along with the above taint with NoSchedule Effect:
You can alternatively apply the following YAML to add the taint:
104
+
105
+
[source,yaml]
106
+
----
107
+
kind: Node
108
+
apiVersion: v1
109
+
metadata:
110
+
name: <node_name>
111
+
labels:
112
+
...
113
+
spec:
114
+
taints:
115
+
- key: node-role.kubernetes.io/infra
116
+
effect: NoExecute
117
+
value: reserved
118
+
...
119
+
----
120
+
====
121
+
+
122
+
This example places a taint on `node1` that has the key `node-role.kubernetes.io/infra` and taint effect `NoExecute`. Nodes with the `NoExecute` effect schedule only pods that tolerate the taint. The effect will remove any existing pods from the node that do not have a matching toleration.
123
+
+
124
+
125
+
87
126
. 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:
88
127
+
89
128
[source,yaml]
90
129
----
91
130
tolerations:
92
-
- effect: NoExecute <1>
131
+
- effect: NoSchedule <1>
93
132
key: node-role.kubernetes.io/infra <2>
94
-
operator: Exists <3>
95
-
value: reserved <4>
133
+
value: reserved <3>
134
+
- effect: NoExecute <4>
135
+
key: node-role.kubernetes.io/infra <5>
136
+
operator: Exists <6>
137
+
value: reserved <7>
96
138
----
97
139
<1> Specify the effect that you added to the node.
98
140
<2> Specify the key that you added to the node.
99
-
<3> Specify the `Exists` Operator to require a taint with the key `node-role.kubernetes.io/infra` to be present on the node.
100
-
<4> Specify the value of the key-value pair taint that you added to the node.
141
+
<3> Specify the value of the key-value pair taint that you added to the node.
142
+
<4> Specify the effect that you added to the node.
143
+
<5> Specify the key that you added to the node.
144
+
<6> Specify the `Exists` Operator to require a taint with the key `node-role.kubernetes.io/infra` to be present on the node.
145
+
<7> Specify the value of the key-value pair taint that you added to the node.
101
146
+
102
147
This toleration matches the taint created by the `oc adm taint` command. A pod with this toleration can be scheduled onto the infra node.
0 commit comments