Prerequisites
Before you begin, you must:
Replace a worker node
In certain situations, you may want to delete a worker node and have Cluster API replace it with a newly provisioned machine.
-
Identify the name of the node to delete.
List the nodes:
The output from this command resembles the following:
-
Export a variable with the node name to use in the next steps:
This example uses the name
ip-10-0-118-168.us-west-2.compute.internal
. -
Delete the Machine resource
The command will not return immediately. It will return once the Machine resource has been deleted.
A few minutes after the Machine resource is deleted, the corresponding Node resource is also deleted.
-
Observe that the Machine resource is being replaced using this command:
There are 2 replicas, but only 1 is ready. There is 1 unavailable replica, and the
ScalingUp
phase means a new Machine is being created. -
Identify the replacement Machine using this command:
If the output is empty, the new Machine has probably exited the
Provisioning
phase and entered theRunning
phase. -
Identify the replacement Node using this command:
If the output is empty, the Node resource is not yet available, or does not yet have the expected annotation. Wait a few minutes, then repeat the command.