Skip to content

Commit 3c0ea21

Browse files
authored
Merge pull request #108928 from openshift-cherrypick-robot/cherry-pick-107857-to-enterprise-4.17
[enterprise-4.17] OSDOCS-17042 Deleting Machine CQA
2 parents d8bfe35 + 79609be commit 3c0ea21

6 files changed

Lines changed: 42 additions & 27 deletions

machine_management/deleting-machine.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
You can delete a specific machine.
9+
[role="_abstract"]
10+
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.
1011

1112
//Deleting a specific machine
1213
include::modules/machine-delete.adoc[leveloffset=+1]

modules/machine-delete.adoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
[id="machine-delete_{context}"]
88
= Deleting a specific machine
99

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.
1112

1213
[IMPORTANT]
1314
====
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.
1516
====
1617

1718
.Prerequisites
@@ -40,11 +41,11 @@ The command output contains a list of machines in the `<clusterid>-<role>-<cloud
4041
$ oc delete machine <machine> -n openshift-machine-api
4142
----
4243
+
44+
Replace `<machine>` with the name of the machine.
45+
+
4346
[IMPORTANT]
4447
====
4548
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.
4649

4750
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.
51+
====

modules/machine-lifecycle-hook-deletion-etcd.adoc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
[id="machine-lifecycle-hook-deletion-etcd_{context}"]
77
= Quorum protection with machine lifecycle hooks
88

9-
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.
1011

1112
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.
1213

@@ -47,9 +48,11 @@ metadata:
4748
spec:
4849
lifecycleHooks:
4950
preDrain:
50-
- name: EtcdQuorumOperator <1>
51-
owner: clusteroperator/etcd <2>
51+
- name: EtcdQuorumOperator
52+
owner: clusteroperator/etcd
5253
...
5354
----
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.

modules/machine-lifecycle-hook-deletion-format.adoc

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[id="machine-lifecycle-hook-deletion-format_{context}"]
77
= Deletion lifecycle hook configuration
88

9+
[role="_abstract"]
910
The following YAML snippets demonstrate the format and placement of deletion lifecycle hook configurations within a machine set:
1011

1112
.YAML snippet demonstrating a `preDrain` lifecycle hook
@@ -18,12 +19,14 @@ metadata:
1819
spec:
1920
lifecycleHooks:
2021
preDrain:
21-
- name: <hook_name> <1>
22-
owner: <hook_owner> <2>
22+
- name: <hook_name>
23+
owner: <hook_owner>
2324
...
2425
----
25-
<1> The name of the `preDrain` lifecycle hook.
26-
<2> The hook-implementing controller that manages the `preDrain` lifecycle hook.
26+
where:
27+
28+
`<hook_name>`:: Specifies the name of the `preDrain` lifecycle hook.
29+
`<hook_owner>`:: Specifies the hook-implementing controller that manages the `preDrain` lifecycle hook.
2730

2831
.YAML snippet demonstrating a `preTerminate` lifecycle hook
2932
[source,yaml]
@@ -35,13 +38,14 @@ metadata:
3538
spec:
3639
lifecycleHooks:
3740
preTerminate:
38-
- name: <hook_name> <1>
39-
owner: <hook_owner> <2>
41+
- name: <hook_name>
42+
owner: <hook_owner>
4043
...
4144
----
42-
<1> The name of the `preTerminate` lifecycle hook.
43-
<2> The hook-implementing controller that manages the `preTerminate` lifecycle hook.
45+
where:
4446

47+
`<hook_name>`:: Specifies the name of the `preDrain` lifecycle hook.
48+
`<hook_owner>`:: Specifies the hook-implementing controller that manages the `preDrain` lifecycle hook.
4549

4650
[id="machine-lifecycle-hook-deletion-example_{context}"]
4751
== Example lifecycle hook configuration
@@ -57,18 +61,19 @@ metadata:
5761
...
5862
spec:
5963
lifecycleHooks:
60-
preDrain: <1>
64+
preDrain:
6165
- name: MigrateImportantApp
6266
owner: my-app-migration-controller
63-
preTerminate: <2>
67+
preTerminate:
6468
- name: BackupFileSystem
6569
owner: my-backup-controller
6670
- name: CloudProviderSpecialCase
67-
owner: my-custom-storage-detach-controller <3>
71+
owner: my-custom-storage-detach-controller
6872
- name: WaitForStorageDetach
6973
owner: my-custom-storage-detach-controller
7074
...
7175
----
72-
<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.

modules/machine-lifecycle-hook-deletion-uses.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
[id="machine-lifecycle-hook-deletion-uses_{context}"]
77
= Machine deletion lifecycle hook examples for Operator developers
88

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.
1011

12+
The following examples demonstrate possible ways that an Operator can use this functionality.
1113

1214
[id="machine-lifecycle-hook-deletion-uses-predrain_{context}"]
1315
== Example use cases for `preDrain` lifecycle hooks

modules/machine-lifecycle-hook-deletion.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
[id="machine-lifecycle-hook-deletion_{context}"]
1010
= Lifecycle hooks for the machine deletion phase
1111

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.
1316

1417
[id="machine-lifecycle-hook-deletion-terms_{context}"]
1518
== Terminology and definitions

0 commit comments

Comments
 (0)