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
Copy file name to clipboardExpand all lines: modules/creating-an-infra-node.adoc
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,8 @@ $ oc get nodes
42
42
If the default node selector key conflicts with the key of a pod's label, then the default node selector is not applied.
43
43
44
44
However, do not set a default node selector that might cause a pod to become unschedulable. For example, setting the default node selector to a specific node role, such as `node-role.kubernetes.io/infra=""`, when a pod's label is set to a different node role, such as `node-role.kubernetes.io/master=""`, can cause the pod to become unschedulable. For this reason, it is not recommended to set the default node selector to specific node roles.
45
+
46
+
You can alternatively use a project node selector to avoid cluster-wide node selector key conflicts.
Copy file name to clipboardExpand all lines: modules/nodes-scheduler-node-selectors-about.adoc
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ You can use a node selector to place specific pods on specific nodes, cluster-wi
11
11
12
12
For example, as a cluster administrator, you can create an infrastructure where application developers can deploy pods only onto the nodes closest to their geographical location by including a node selector in every pod they create. In this example, the cluster consists of five data centers spread across two regions. In the U.S., label the nodes as `us-east`, `us-central`, or `us-west`. In the Asia-Pacific region (APAC), label the nodes as `apac-east` or `apac-west`. The developers can add a node selector to the pods they create to ensure the pods get scheduled on those nodes.
13
13
14
-
A pod is not scheduled if the `Pod` object contains a node selector, but no node has a matching label.
14
+
A pod is not scheduled if the `Pod` object contains a node selector, but no node has a matching label.
15
15
16
16
[IMPORTANT]
17
17
====
@@ -35,7 +35,7 @@ To use node selectors and labels, first label the node to avoid pods being desch
35
35
You cannot add a node selector directly to an existing scheduled pod. You must label the object that controls the pod, such as deployment config.
36
36
====
37
37
+
38
-
For example, the following `Node` object has the `region: east` label:
38
+
For example, the following `Node` object has the `region: east` label:
39
39
+
40
40
ifndef::openshift-origin[]
41
41
.Sample `Node` object with a label
@@ -112,7 +112,7 @@ When you create the pod using the example pod spec, it can be scheduled on the e
112
112
Default cluster-wide node selectors::
113
113
+
114
114
With default cluster-wide node selectors, when you create a pod in that cluster, {product-title} adds the default node selectors to the pod and schedules
115
-
the pod on nodes with matching labels.
115
+
the pod on nodes with matching labels.
116
116
+
117
117
For example, the following `Scheduler` object has the default cluster-wide `region=east` and `type=user-node` node selectors:
If the project where you create the pod has a project node selector, that selector takes preference over a cluster-wide node selector. Your pod is not created or scheduled if the pod does not have the project node selector.
174
174
====
175
175
176
+
[id="project-node-selectors_{context}"]
176
177
Project node selectors::
177
178
+
178
179
With project node selectors, when you create a pod in this project, {product-title} adds the node selectors to the pod and schedules the pods on a node with matching labels. If there is a cluster-wide default node selector, a project node selector takes preference.
@@ -205,7 +206,7 @@ metadata:
205
206
region: east
206
207
type: user-node
207
208
...
208
-
----
209
+
----
209
210
+
210
211
When you create the pod using the example pod spec in this example project, the pod is created with the project node selectors and is scheduled on the labeled node:
* For information on how to configure project node selectors to avoid cluster-wide node selector key conflicts, see xref:../nodes/scheduling/nodes-scheduler-node-selectors.adoc#project-node-selectors_nodes-scheduler-node-selectors[Project node selectors].
0 commit comments