This section instructs you on how to scale down an existing management
or managed cluster through the Container Cloud API. To delete a
machine using the Container Cloud web UI, see Delete a cluster machine using web UI.
Using the Container Cloud API, you can delete a cluster machine using the
following methods:
Recommended. Enable the delete field in the providerSpec section of
the required Machine object. It allows aborting graceful machine
deletion before the node is removed from Docker Swarm.
Not recommended. Apply the delete request to the Machine object.
You can control machine deletion steps by following a specific machine
deletion policy.
The deletion policy of the Machine resource used in the Container Cloud
API defines specific steps occurring before a machine deletion.
The Container Cloud API contains the following types of deletion policies:
graceful, unsafe, forced. By default, the graceful deletion policy is used.
You can change the deletion policy before the machine deletion. If the
deletion process has already started, you can reduce the deletion policy
restrictions in the following order only: graceful > unsafe > forced.
During a forced machine deletion, the provider and LCM controllers perform
the following steps:
Send the delete request to the corresponding Machine resource.
Remove the provider resources such as the VM instance, network, volume,
and so on. Remove the related Kubernetes resources.
Remove the finalizer from the Machine resource. This step completes
the machine deletion from Kubernetes resources.
This policy type allows deleting a Machine resource even if the provider or
LCM controller gets stuck at some step. But this policy may require a manual
cleanup of machine resources in case of a controller failure. For details, see
Delete a machine from a cluster using CLI.
Caution
Consider the following precautions applied to the forced
machine deletion policy:
Use the forced machine deletion only if either graceful or unsafe machine
deletion fails.
If the forced machine deletion fails at any step, the LCM Controller
removes the finalizer anyway.
Before starting the forced machine deletion, back up the related
Machine resource:
Log in to the host where your management cluster kubeconfig is located
and where kubectl is installed.
For the bare metal provider, ensure that the machine being deleted is not
a Ceph Monitor. If it is, migrate the Ceph Monitor to keep the odd number
quorum of Ceph Monitors after the machine deletion. For details, see
Migrate a Ceph Monitor before machine replacement.
Select from the following options:
Recommended. In the providerSpec.value section of the Machine
object, set delete to true:
Since the management cluster update to 16.4.0 (MCC 2.29.0)
Caution
While the Cluster release of the management cluster is 16.4.0,
BareMetalHostInventory operations are allowed to
m:kaas@management-admin only. This limitation is lifted once the
management cluster is updated to the Cluster release 16.4.1 or later.