mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
75 lines
2.6 KiB
Plaintext
75 lines
2.6 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * post_installation_configuration/cluster-tasks.adoc
|
|
|
|
:_content-type: PROCEDURE
|
|
[id="creating-an-infra-node_{context}"]
|
|
= Creating an infrastructure node
|
|
|
|
[IMPORTANT]
|
|
====
|
|
See Creating infrastructure machine sets for installer-provisioned infrastructure environments or for any cluster where the control plane nodes are managed by the machine API.
|
|
====
|
|
|
|
Requirements of the cluster dictate that infrastructure, also called `infra` nodes, be provisioned. The installer only provides provisions for control plane and worker nodes. Worker nodes can be designated as infrastructure nodes or application, also called `app`, nodes through labeling.
|
|
|
|
.Procedure
|
|
|
|
. Add a label to the worker node that you want to act as application node:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc label node <node-name> node-role.kubernetes.io/app=""
|
|
----
|
|
|
|
. Add a label to the worker nodes that you want to act as infrastructure nodes:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc label node <node-name> node-role.kubernetes.io/infra=""
|
|
----
|
|
|
|
. Check to see if applicable nodes now have the `infra` role and `app` roles:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get nodes
|
|
----
|
|
|
|
. Create a default cluster-wide node selector. The default node selector is applied to pods created in all namespaces. This creates an intersection with any existing node selectors on a pod, which additionally constrains the pod's selector.
|
|
+
|
|
[IMPORTANT]
|
|
====
|
|
If the default node selector key conflicts with the key of a pod's label, then the default node selector is not applied.
|
|
|
|
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, use caution when setting the default node selector to specific node roles.
|
|
|
|
You can alternatively use a project node selector to avoid cluster-wide node selector key conflicts.
|
|
====
|
|
|
|
.. Edit the `Scheduler` object:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc edit scheduler cluster
|
|
----
|
|
|
|
.. Add the `defaultNodeSelector` field with the appropriate node selector:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: config.openshift.io/v1
|
|
kind: Scheduler
|
|
metadata:
|
|
name: cluster
|
|
...
|
|
spec:
|
|
defaultNodeSelector: topology.kubernetes.io/region=us-east-1 <1>
|
|
...
|
|
----
|
|
<1> This example node selector deploys pods on nodes in the `us-east-1` region by default.
|
|
|
|
.. Save the file to apply the changes.
|
|
|
|
You can now move infrastructure resources to the newly labeled `infra` nodes.
|