Node Groups
This document explains how custom node groups can be created on OpenShift 4.
In OpenShift 4 the concept of node groups and their labels changed comparing to OpenShift 3.11.
Custom pools are pools that inherit from the worker pool.
The default group with the role worker
is the basis for all other node groups.
The machine-config-operator automatically creates the base MachineConfig
and MachineConfigPool
from a set of templates.
To create a custom node group, the worker
role and it’s configuration should always be reused.
This is done by including the label selector in the custom MachineConfigPool
like this:
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
name: infra
spec:
machineConfigSelector:
matchExpressions:
- {key: machineconfiguration.openshift.io/role, operator: In, values: [worker,infra]}
nodeSelector:
matchLabels:
node-role.kubernetes.io/infra: ""
To use the Machine API, it’s required to either manually create the initial user-data in a secret or reuse the worker-user-data
secret.
Reusing the existing secret will apply only the worker config on first provision and only once the correct labes are set on the new node will the additional config be applied (this may or may not be a problem). |
Also see how to create infra machine sets on GCP.