Manually Scaling Worker Nodes

As mentioned, scaling a cluster can be done in two ways: manually and automatically. The availability of automatic scaling depends on the provider and is supported by the Full-Stack Automation mode (IPI).

Reasons to scale a cluster include minimizing resources congestion and better management of resources, such as dedicating a set of nodes to a particular workload.

Like deployments and deployment configurations, you change the number of instances by adjusting the replicas specified by the MachineSet resource.

oc scale --replicas=2 \
> machineset MACHINE-SET -n openshift-machine-api

If the number of workers in the availability zone does not match the replica count, OKD spawns news workers until the number of worker matches the replica count.

Aside from scaling, changes to a machine set do not affect existing machines. New machines inherit changes made to a machine set, such as new or updated labels.

Scaling down is straightforward. Scaling down the machine set instructs the scheduler to evacuate the pods running on machines in the machine set.

Scaling down only works if the remaining nodes have enough capacity to run the pods. If there are not enough resources, the controller refuses to scale in.

Daftar Materi