Create an infrastructure node
To reduce subscription costs, you can use labels to configure compute nodes as infrastructure nodes, where you can move infrastructure resources.
After you create the infrastructure nodes, you can move appropriate workloads to those nodes by using taints and tolerations.
You can optionally create a default cluster-wide node selector. The default node selector is applied to pods created in all namespaces and creates an intersection with any existing node selectors on a pod, which additionally constrains the pod’s selector.
|
|
|
-
Add a label to the compute nodes that you want to act as infrastructure nodes by running the following command:
$ oc label node <node-name> node-role.kubernetes.io/infra="" -
Check to see if applicable nodes now have the
infrarole by running the following command:$ oc get nodes -
Optional: Create a default cluster-wide node selector.
-
Edit the
Schedulerobject by running the following command:$ oc edit scheduler cluster -
Add the
defaultNodeSelectorfield with the appropriate node selector by running the following command:apiVersion: config.openshift.io/v1 kind: Scheduler metadata: name: cluster spec: defaultNodeSelector: node-role.kubernetes.io/infra="" # ...This example node selector deploys pods on infrastructure nodes by default.
-
Save the file to apply the changes.
You can now move infrastructure resources to the new infrastructure nodes and remove any workloads that you do not want, or that do not belong, on the new infrastructure node. See the list of workloads supported for use on infrastructure nodes in "Red Hat OpenShift Container Platform infrastructure components".
-