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
Copy file name to clipboardExpand all lines: content/en/docs/getting-started/installation/register-a-cluster.md
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -316,3 +316,39 @@ Check the klusterlet is removed from the managed cluster.
316
316
kubectl get klusterlet --context ${CTX_MANAGED_CLUSTER}
317
317
error: the server doesn't have a resource type "klusterlet
318
318
```
319
+
320
+
### Resource cleanup when the managed cluster is deleted
321
+
322
+
When a user deletes the managedCluster resource, all associated resources within the cluster namespace must also be removed. This includes managedClusterAddons, manifestWorks, and the roleBindings for the klusterlet agent. Resource cleanup follows a specific sequence to prevent resources from being stuck in a terminating state:
323
+
324
+
1. managedClusterAddons are deleted first.
325
+
2. manifestWorks are removed subsequently after all managedClusterAddons are deleted.
326
+
3. For the same resource as managedClusterAddon or manifestWork, custom deletion ordering can be defined using the `open-cluster-management.io/cleanup-priority` annotation:
327
+
- Priority values range from 0 to 100 (lower values execute first).
328
+
329
+
The `open-cluster-management.io/cleanup-priority` annotation controls deletion order when resource instances have dependencies. For example:
330
+
331
+
A manifestWork that applies a CRD and operator should be deleted after a manifestWork that creates a CR instance, allowing the operator to perform cleanup after the CR is removed.
332
+
333
+
334
+
The `ResourceCleanup` featureGate for cluster registration on the Hub cluster enables automatic cleanup of managedClusterAddons and manifestWorks within the cluster namespace after cluster unjoining.
335
+
336
+
**Version Compatibility:**
337
+
- The `ResourceCleanup` featureGate was introdueced in OCM v0.13.0, and was **disabled by default** in OCM v0.16.0 and earlier versions. To activate it, need to modify the clusterManager CR configuration:
338
+
```yaml
339
+
registrationConfiguration:
340
+
featureGates:
341
+
- feature: ResourceCleanup
342
+
mode: Enable
343
+
```
344
+
345
+
- Starting with OCM v0.17.0, the `ResourceCleanup` featureGate has been upgraded from Alpha to Beta status and is **enabled by default**.
346
+
347
+
**Disabling the Feature:**
348
+
To deactivate this functionality, update the clusterManager CR on the hub cluster:
0 commit comments