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: docs/book/src/topics/external-resource-gc.md
+15-17Lines changed: 15 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -5,23 +5,25 @@
5
5
6
6
## Overview
7
7
8
-
Workload clusters that have been created by CAPA may have additional resources in AWS that need to be deleted when the cluster is deleted.
8
+
Workload clusters that CAPA has created may have additional resources in AWS that need to be deleted when the cluster is deleted.
9
9
10
-
For example, if the workload cluster has `Services` of type `LoadBalancer` then there will be AWS ELB/NLB provisioned. If you try to delete the workload cluster in this example it will fail as the VPC is still being used by these load balancers.
10
+
For example, if the workload cluster has `Services` of type `LoadBalancer` then AWS ELB/NLB are provisioned. If you try to delete the workload cluster in this example, it will fail as these load balancers are still using the VPC.
11
11
12
-
This feature enables deleting these external resources as part of cluster deletion. It works by annotating the AWS infra cluster / control plane on creation. When a CAPI `Cluster` is requested to be deleted the deletion of CAPA resources is blocked depending on the status of this annotation. When the resources have been garbage collected (i.e. deleted) then the annotation is updated and normal CAPA deletion starts. This is not related to [externally managed infrastructure](https://cluster-api-aws.sigs.k8s.io/topics/bring-your-own-aws-infrastructure.html).
12
+
This feature enables deletion of these external resources as part of cluster deletion. During the deletion of a workload cluster the external AWS resources that where created by the Cloud Controller Manager (CCM) in the workload cluster will be identified and deleted.
13
13
14
-
Currently we support cleaning up the following:
14
+
> NOTE: This is not related to [externally managed infrastructure](https://cluster-api-aws.sigs.k8s.io/topics/bring-your-own-aws-infrastructure.html).
15
+
16
+
Currently, we support cleaning up the following:
15
17
16
18
- AWS ELB/NLB - by deleting `Services` of type `LoadBalancer` from the workload cluster
17
19
18
-
We will look to potentially supporting deleting EBS volumes in the future.
20
+
We will look to support deleting EBS volumes in the future potentially.
19
21
20
22
> Note: this feature will likely be superseded by an upstream CAPI feature in the future when [this issue](https://github.com/kubernetes-sigs/cluster-api/issues/3075) is resolved.
21
23
22
24
## Enabling
23
25
24
-
To enable this you must set the `ExternalResourceGC` to `true` on the controller manager. The easiest way to do this is via an environment variable:
26
+
To enable garbage collection, you must set the `ExternalResourceGC` feature gate to `true` on the controller manager. The easiest way to do this is via an environment variable:
25
27
26
28
```bash
27
29
export EXP_EXTERNAL_RESOURCE_GC=true
@@ -38,7 +40,7 @@ There are 2 ways to manually disable garbage collection for an individual cluste
38
40
39
41
#### Using `clusterawsadm`
40
42
41
-
You can disable garbage collection for a cluster by running the following command:
43
+
By running the following command:
42
44
43
45
```bash
44
46
clusterawsadm gc disable --cluster-name mycluster
@@ -48,25 +50,23 @@ See the command help for more examples.
48
50
49
51
#### Editing `AWSCluster\AWSManagedControlPlane`
50
52
51
-
You can disable garbage collection for a cluster by editing your `AWSCluster` or `AWSManagedControlPlane`.
52
-
53
-
Either remove the `aws.cluster.x-k8s.io/external-resource-gc` or set its value to **true**.
53
+
Or, by editing your `AWSCluster` or `AWSManagedControlPlane` so that the annotation `aws.cluster.x-k8s.io/external-resource-gc` is set to **false**.
### Manually Enablind Garbage Collection for a Cluster
63
+
### Manually Enabling Garbage Collection for a Cluster
64
64
65
65
There are 2 ways to manually enable garbage collection for an individual cluster:
66
66
67
67
#### Using `clusterawsadm`
68
68
69
-
You can enable garbage collection for a cluster by running the following command:
69
+
By running the following command:
70
70
71
71
```bash
72
72
clusterawsadm gc enable --cluster-name mycluster
@@ -76,14 +76,12 @@ See the command help for more examples.
76
76
77
77
#### Editing `AWSCluster\AWSManagedControlPlane`
78
78
79
-
You can enable garbage collection for a cluster by editing your `AWSCluster` or `AWSManagedControlPlane`.
80
-
81
-
Add the `aws.cluster.x-k8s.io/external-resource-gc` annotation if it doesn't exist and set its value to **false**.
79
+
Or, by editing your `AWSCluster` or `AWSManagedControlPlane` o that the annotation `aws.cluster.x-k8s.io/external-resource-gc` is either removed or set to **true**.
0 commit comments