Skip to content

Commit 471c6a4

Browse files
authored
Merge pull request #35894 from bergerhoffer/BZ-1979431-link
BZ-1979431: Adding link to configuring project node selectors
2 parents ebd6e5b + b4db264 commit 471c6a4

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

modules/creating-an-infra-node.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ $ oc get nodes
4242
If the default node selector key conflicts with the key of a pod's label, then the default node selector is not applied.
4343
4444
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.
4547
====
4648

4749
.. Edit the `Scheduler` object:
@@ -64,7 +66,7 @@ spec:
6466
defaultNodeSelector: node-role.kubernetes.io/app= <1>
6567
...
6668
----
67-
<1> This example node selector deploys pods on worker nodes by default.
69+
<1> This example node selector deploys pods on app nodes by default.
6870

6971
.. Save the file to apply the changes.
7072

modules/nodes-scheduler-node-selectors-about.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can use a node selector to place specific pods on specific nodes, cluster-wi
1111

1212
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.
1313

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.
1515

1616
[IMPORTANT]
1717
====
@@ -35,7 +35,7 @@ To use node selectors and labels, first label the node to avoid pods being desch
3535
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.
3636
====
3737
+
38-
For example, the following `Node` object has the `region: east` label:
38+
For example, the following `Node` object has the `region: east` label:
3939
+
4040
ifndef::openshift-origin[]
4141
.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
112112
Default cluster-wide node selectors::
113113
+
114114
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.
116116
+
117117
For example, the following `Scheduler` object has the default cluster-wide `region=east` and `type=user-node` node selectors:
118118
+
@@ -144,7 +144,7 @@ metadata:
144144
region: east
145145
type: user-node
146146
...
147-
----
147+
----
148148
+
149149
.Example `Pod` object with a node selector
150150
[source,terminal]
@@ -173,6 +173,7 @@ pod-s1 1/1 Running 0 20s 10.131.2.6 ci-ln-qg1il3k-f76d1-hlm
173173
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.
174174
====
175175

176+
[id="project-node-selectors_{context}"]
176177
Project node selectors::
177178
+
178179
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:
205206
region: east
206207
type: user-node
207208
...
208-
----
209+
----
209210
+
210211
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:
211212
+
@@ -246,4 +247,3 @@ spec:
246247
247248
....
248249
----
249-

post_installation_configuration/cluster-tasks.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ include::modules/machineset-creating.adoc[leveloffset=+2]
513513

514514
include::modules/creating-an-infra-node.adoc[leveloffset=+2]
515515

516+
.Additional resources
517+
518+
* 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].
519+
516520
include::modules/creating-infra-machines.adoc[leveloffset=+2]
517521

518522
.Additional resources

0 commit comments

Comments
 (0)