You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you need to remove a machine from your cluster, you can delete a specific machine. If the machine is part of a machine set, deleting the machine can help troubleshoot and resolve unhealthy nodes and other technical issues.
Copy file name to clipboardExpand all lines: modules/machine-delete.adoc
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,12 @@
7
7
[id="machine-delete_{context}"]
8
8
= Deleting a specific machine
9
9
10
-
You can delete a specific machine.
10
+
[role="_abstract"]
11
+
To remove a machine from your cluster, or restart a machine that is part of a machine set, you can use the {oc-first} to delete a specific machine.
11
12
12
13
[IMPORTANT]
13
14
====
14
-
Do not delete a control plane machine unless your cluster uses a control plane machine set.
15
+
Do not delete a control plane machine unless your cluster uses a control plane machine set. If the machine that you delete belongs to a machine set, a new machine is immediately created to satisfy the specified number of replicas.
15
16
====
16
17
17
18
.Prerequisites
@@ -40,11 +41,11 @@ The command output contains a list of machines in the `<clusterid>-<role>-<cloud
By default, the machine controller tries to drain the node that is backed by the machine until it succeeds. In some situations, such as with a misconfigured pod disruption budget, the drain operation might not be able to succeed. If the drain operation fails, the machine controller cannot proceed removing the machine.
46
49
47
50
You can skip draining the node by annotating `machine.openshift.io/exclude-node-draining` in a specific machine.
48
-
====
49
-
+
50
-
If the machine that you delete belongs to a machine set, a new machine is immediately created to satisfy the specified number of replicas.
For {product-title} clusters that use the Machine API Operator, the etcd Operator uses lifecycle hooks for the machine deletion phase to implement a quorum protection mechanism.
9
+
[role="_abstract"]
10
+
To protect etcd quorum on {product-title} clusters that use the Machine API Operator, the etcd Operator uses lifecycle hooks for the machine deletion phase to implement a quorum protection mechanism.
10
11
11
12
By using a `preDrain` lifecycle hook, the etcd Operator can control when the pods on a control plane machine are drained and removed. To protect etcd quorum, the etcd Operator prevents the removal of an etcd member until it migrates that member onto a new node within the cluster.
12
13
@@ -47,9 +48,11 @@ metadata:
47
48
spec:
48
49
lifecycleHooks:
49
50
preDrain:
50
-
- name: EtcdQuorumOperator <1>
51
-
owner: clusteroperator/etcd <2>
51
+
- name: EtcdQuorumOperator
52
+
owner: clusteroperator/etcd
52
53
...
53
54
----
54
-
<1> The name of the `preDrain` lifecycle hook.
55
-
<2> The hook-implementing controller that manages the `preDrain` lifecycle hook.
55
+
where:
56
+
57
+
`spec.lifecycleHooks.preDrain.name`:: Specifies the name of the `preDrain` lifecycle hook.
58
+
`spec.lifecycleHooks.preDrain.owner`:: Specifies the hook-implementing controller that manages the `preDrain` lifecycle hook.
<1> A `preDrain` lifecycle hook stanza that contains a single lifecycle hook.
73
-
<2> A `preTerminate` lifecycle hook stanza that contains three lifecycle hooks.
74
-
<3> A hook-implementing controller that manages two `preTerminate` lifecycle hooks: `CloudProviderSpecialCase` and `WaitForStorageDetach`.
76
+
where:
77
+
78
+
`spec.lifecycleHooks.preDrain`:: Specifies a `preDrain` lifecycle hook stanza that contains a single lifecycle hook.
79
+
`spec.lifecycleHooks.preTerminate`:: Specifies a `preTerminate` lifecycle hook stanza that contains three lifecycle hooks. Note that one controller can own multiple lifecycle hooks, as `my-custom-storage-detach-controller` does in the example.
= Machine deletion lifecycle hook examples for Operator developers
8
8
9
-
Operators can use lifecycle hooks for the machine deletion phase to modify the machine deletion process. The following examples demonstrate possible ways that an Operator can use this functionality.
9
+
[role="_abstract"]
10
+
Operators can use lifecycle hooks for the machine deletion phase to modify the machine deletion process.
10
11
12
+
The following examples demonstrate possible ways that an Operator can use this functionality.
Copy file name to clipboardExpand all lines: modules/machine-lifecycle-hook-deletion.adoc
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,10 @@
9
9
[id="machine-lifecycle-hook-deletion_{context}"]
10
10
= Lifecycle hooks for the machine deletion phase
11
11
12
-
Machine lifecycle hooks are points in the reconciliation lifecycle of a machine where the normal lifecycle process can be interrupted. In the machine `Deleting` phase, these interruptions provide the opportunity for components to modify the machine deletion process.
12
+
[role="_abstract"]
13
+
You can use lifecycle hooks to modify the process of machine deletion. Machine lifecycle hooks are points in the reconciliation lifecycle of a machine where the normal lifecycle process can be interrupted.
14
+
15
+
For example, you might use a `preDrain` lifecycle hook to maintain etcd quorum when deleting a control plane machine.
0 commit comments