Skip to content

Commit 4ee3bd7

Browse files
committed
Update instructions for deleting a node
1 parent 214361a commit 4ee3bd7

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

modules/ztp-deleting-node-using-siteconfig.adoc

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="ztp-deleting-node-siteconfig_{context}"]
77
= Deleting a node by using the SiteConfig CR
88

9-
By using a `SiteConfig` custom resource (CR), you can delete and reprovision a node.
9+
By using a `SiteConfig` custom resource (CR), you can delete and reprovision a node.
1010
This method is more efficient than manually deleting the node.
1111

1212
.Prerequisites
@@ -18,7 +18,7 @@ This method is more efficient than manually deleting the node.
1818
1919
.Procedure
2020

21-
. Update the `SiteConfig` CR to include the `bmac.agent-install.openshift.io/remove-agent-and-node-on-delete=true` annotation:
21+
. Update the `SiteConfig` CR to include the `bmac.agent-install.openshift.io/remove-agent-and-node-on-delete=true` annotation and push the changes to the Git repository:
2222
+
2323
[source,yaml]
2424
----
@@ -28,7 +28,7 @@ metadata:
2828
name: "cnfdf20"
2929
namespace: "cnfdf20"
3030
spec:
31-
Clusters:
31+
clusters:
3232
nodes:
3333
- hostname: node6
3434
role: "worker"
@@ -39,6 +39,19 @@ spec:
3939
# ...
4040
----
4141

42+
. Verify that the `BareMetalHost` object is annotated by running the following command:
43+
+
44+
[source,yaml]
45+
----
46+
oc get bmh -n <managed-cluster-namespace> <bmh-object> -ojsonpath='{.metadata}' | jq -r '.annotations["bmac.agent-install.openshift.io/remove-agent-and-node-on-delete"]'
47+
----
48+
+
49+
.Example output
50+
[source,terminal]
51+
----
52+
true
53+
----
54+
4255
. Suppress the generation of the `BareMetalHost` CR by updating the `SiteConfig` CR to include the `crSuppression.BareMetalHost` annotation:
4356
+
4457
[source,yaml]
@@ -58,7 +71,7 @@ spec:
5871
# ...
5972
----
6073

61-
. Push the changes to the Git repository and wait for deprovisioning to start.
74+
. Push the changes to the Git repository and wait for deprovisioning to start.
6275
The status of the `BareMetalHost` CR should change to `deprovisioning`. Wait for the `BareMetalHost` to finish deprovisioning, and be fully deleted.
6376

6477
.Verification
@@ -84,11 +97,11 @@ $ oc get nodes
8497
+
8598
[NOTE]
8699
====
87-
If you are working with secrets, deleting a secret too early can cause an issue because ArgoCD needs the secret to complete resynchronization after deletion.
100+
If you are working with secrets, deleting a secret too early can cause an issue because ArgoCD needs the secret to complete resynchronization after deletion.
88101
Delete the secret only after the node cleanup, when the current ArgoCD synchronization is complete.
89102
====
90103

91104
.Next Steps
92105

93-
To reprovision a node, delete the changes previously added to the `SiteConfig`, push the changes to the Git repository, and wait for the synchronization to complete.
106+
To reprovision a node, delete the changes previously added to the `SiteConfig`, push the changes to the Git repository, and wait for the synchronization to complete.
94107
This regenerates the `BareMetalHost` CR of the worker node and triggers the re-install of the node.

0 commit comments

Comments
 (0)