Skip to content

Commit 310ad99

Browse files
authored
Merge pull request #5348 from richardcase/graduate_gc
🌱 chore: graduate garbage collection
2 parents 2cf25eb + 6f1e7af commit 310ad99

File tree

14 files changed

+68
-492
lines changed

14 files changed

+68
-492
lines changed

Makefile

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -433,15 +433,6 @@ test-e2e: $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) generate-test-flavors e2e-image ##
433433
test-e2e-eks: generate-test-flavors $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks e2e tests
434434
time go run github.com/onsi/ginkgo/v2/ginkgo -tags=e2e $(GINKGO_ARGS) ./test/e2e/suites/managed/... -- -config-path="$(E2E_EKS_CONF_PATH)" --source-template="$(EKS_SOURCE_TEMPLATE)" $(E2E_ARGS) $(EKS_E2E_ARGS)
435435

436-
.PHONY: test-e2e-gc ## Run garbage collection e2e tests using clusterctl
437-
test-e2e-gc: generate-test-flavors $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks e2e tests
438-
time go run github.com/onsi/ginkgo/v2/ginkgo -tags=e2e -focus="$(GINKGO_FOCUS)" -skip="$(GINKGO_SKIP)" $(GINKGO_ARGS) -p ./test/e2e/suites/gc_unmanaged/... -- -config-path="$(E2E_CONF_PATH)" $(E2E_ARGS)
439-
440-
.PHONY: test-e2e-eks-gc ## Run EKS garbage collection e2e tests using clusterctl
441-
test-e2e-eks-gc: generate-test-flavors $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks e2e tests
442-
time go run github.com/onsi/ginkgo/v2/ginkgo -tags=e2e -focus="$(GINKGO_FOCUS)" -skip="$(GINKGO_SKIP)" $(GINKGO_ARGS) ./test/e2e/suites/gc_managed/... -- -config-path="$(E2E_EKS_CONF_PATH)" --source-template="$(EKS_SOURCE_TEMPLATE)" $(E2E_ARGS) $(EKS_E2E_ARGS)
443-
444-
445436
CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
446437
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)
447438
CONFORMANCE_GINKGO_ARGS += $(GINKGO_ARGS)
@@ -464,8 +455,6 @@ compile-e2e: ## Test e2e compilation
464455
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/unmanaged
465456
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/conformance
466457
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/managed
467-
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/gc_managed
468-
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/gc_unmanaged
469458

470459

471460
.PHONY: docker-pull-e2e-preloads

config/manager/manager.yaml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,38 @@ spec:
1717
control-plane: capa-controller-manager
1818
spec:
1919
containers:
20-
- args:
21-
- "--leader-elect"
22-
- "--feature-gates=EKS=${CAPA_EKS:=true},EKSEnableIAM=${CAPA_EKS_IAM:=false},EKSAllowAddRoles=${CAPA_EKS_ADD_ROLES:=false},EKSFargate=${EXP_EKS_FARGATE:=false},MachinePool=${EXP_MACHINE_POOL:=false},EventBridgeInstanceState=${EVENT_BRIDGE_INSTANCE_STATE:=false},AutoControllerIdentityCreator=${AUTO_CONTROLLER_IDENTITY_CREATOR:=true},BootstrapFormatIgnition=${EXP_BOOTSTRAP_FORMAT_IGNITION:=false},ExternalResourceGC=${EXP_EXTERNAL_RESOURCE_GC:=false},AlternativeGCStrategy=${EXP_ALTERNATIVE_GC_STRATEGY:=false},TagUnmanagedNetworkResources=${TAG_UNMANAGED_NETWORK_RESOURCES:=true},ROSA=${EXP_ROSA:=false}"
23-
- "--v=${CAPA_LOGLEVEL:=0}"
24-
- "--diagnostics-address=${CAPA_DIAGNOSTICS_ADDRESS:=:8443}"
25-
- "--insecure-diagnostics=${CAPA_INSECURE_DIAGNOSTICS:=false}"
26-
image: controller:latest
27-
imagePullPolicy: Always
28-
name: manager
29-
ports:
30-
- containerPort: 9440
31-
name: healthz
32-
protocol: TCP
33-
- containerPort: 8443
34-
name: metrics
35-
protocol: TCP
36-
readinessProbe:
37-
httpGet:
38-
path: /readyz
39-
port: healthz
40-
livenessProbe:
41-
httpGet:
42-
path: /healthz
43-
port: healthz
44-
securityContext:
45-
allowPrivilegeEscalation: false
46-
capabilities:
47-
drop:
48-
- ALL
49-
runAsUser: 65532
50-
runAsGroup: 65532
51-
terminationMessagePolicy: FallbackToLogsOnError
20+
- args:
21+
- "--leader-elect"
22+
- "--feature-gates=EKS=${CAPA_EKS:=true},EKSEnableIAM=${CAPA_EKS_IAM:=false},EKSAllowAddRoles=${CAPA_EKS_ADD_ROLES:=false},EKSFargate=${EXP_EKS_FARGATE:=false},MachinePool=${EXP_MACHINE_POOL:=false},EventBridgeInstanceState=${EVENT_BRIDGE_INSTANCE_STATE:=false},AutoControllerIdentityCreator=${AUTO_CONTROLLER_IDENTITY_CREATOR:=true},BootstrapFormatIgnition=${EXP_BOOTSTRAP_FORMAT_IGNITION:=false},ExternalResourceGC=${EXTERNAL_RESOURCE_GC:=true},AlternativeGCStrategy=${ALTERNATIVE_GC_STRATEGY:=false},TagUnmanagedNetworkResources=${TAG_UNMANAGED_NETWORK_RESOURCES:=true},ROSA=${EXP_ROSA:=false}"
23+
- "--v=${CAPA_LOGLEVEL:=0}"
24+
- "--diagnostics-address=${CAPA_DIAGNOSTICS_ADDRESS:=:8443}"
25+
- "--insecure-diagnostics=${CAPA_INSECURE_DIAGNOSTICS:=false}"
26+
image: controller:latest
27+
imagePullPolicy: Always
28+
name: manager
29+
ports:
30+
- containerPort: 9440
31+
name: healthz
32+
protocol: TCP
33+
- containerPort: 8443
34+
name: metrics
35+
protocol: TCP
36+
readinessProbe:
37+
httpGet:
38+
path: /readyz
39+
port: healthz
40+
livenessProbe:
41+
httpGet:
42+
path: /healthz
43+
port: healthz
44+
securityContext:
45+
allowPrivilegeEscalation: false
46+
capabilities:
47+
drop:
48+
- ALL
49+
runAsUser: 65532
50+
runAsGroup: 65532
51+
terminationMessagePolicy: FallbackToLogsOnError
5252
securityContext:
5353
runAsNonRoot: true
5454
seccompProfile:
@@ -62,15 +62,15 @@ spec:
6262
affinity:
6363
nodeAffinity:
6464
preferredDuringSchedulingIgnoredDuringExecution:
65-
- weight: 10
66-
preference:
67-
matchExpressions:
68-
- key: ${K8S_CP_LABEL:=node-role.kubernetes.io/control-plane}
69-
operator: Exists
70-
# remove once usage of node-role.kubernetes.io/master is removed from Kubernetes
71-
- weight: 10
72-
preference:
73-
matchExpressions:
74-
- key: node-role.kubernetes.io/master
75-
operator: Exists
65+
- weight: 10
66+
preference:
67+
matchExpressions:
68+
- key: ${K8S_CP_LABEL:=node-role.kubernetes.io/control-plane}
69+
operator: Exists
70+
# remove once usage of node-role.kubernetes.io/master is removed from Kubernetes
71+
- weight: 10
72+
preference:
73+
matchExpressions:
74+
- key: node-role.kubernetes.io/master
75+
operator: Exists
7676
serviceAccountName: manager

devbox.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@
236236
"github:NixOS/nixpkgs/nixpkgs-unstable": {
237237
"resolved": "github:NixOS/nixpkgs/3549532663732bfd89993204d40543e9edaec4f2?lastModified=1742272065&narHash=sha256-ud8vcSzJsZ%2FCK%2Br8%2Fv0lyf4yUntVmDq6Z0A41ODfWbE%3D"
238238
},
239+
"github:NixOS/nixpkgs/nixpkgs-unstable": {
240+
"resolved": "github:NixOS/nixpkgs/573c650e8a14b2faa0041645ab18aed7e60f0c9a?lastModified=1741865919&narHash=sha256-4thdbnP6dlbdq%2BqZWTsm4ffAwoS8Tiq1YResB%2BRP6WE%3D"
241+
},
239242
240243
"last_modified": "2024-12-23T21:10:33Z",
241244
"resolved": "github:NixOS/nixpkgs/de1864217bfa9b5845f465e771e0ecb48b30e02d#go_1_22",

docs/book/src/topics/external-resource-gc.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# External Resource Garbage Collection
22

3-
- **Feature status:** Experimental
3+
- **Feature status:** Stable
44
- **Feature gate (required):** ExternalResourceGC=true
55

66
## Overview
@@ -21,16 +21,16 @@ We will look to support deleting EBS volumes in the future potentially.
2121

2222
> 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.
2323
24-
## Enabling
24+
## Disabling
2525

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:
26+
The garbage collection feature is enabled by default. If you want to disable the feature then you must set the `ExternalResourceGC` feature gate to `false` on the controller manager. The easiest way to do this is via an environment variable:
2727

2828
```bash
29-
export EXP_EXTERNAL_RESOURCE_GC=true
29+
export EXTERNAL_RESOURCE_GC=false
3030
clusterctl init --infrastructure aws
3131
```
3232

33-
> Note: if you enable this feature **ALL** clusters will be marked as requiring garbage collection.
33+
> Note: if you disable this feature **ALL** clusters will be marked as not requiring garbage collection.
3434
3535
## Operations
3636

feature/feature.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ var defaultCAPAFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
111111
MachinePoolMachines: {Default: false, PreRelease: featuregate.Alpha},
112112
AutoControllerIdentityCreator: {Default: true, PreRelease: featuregate.Alpha},
113113
BootstrapFormatIgnition: {Default: false, PreRelease: featuregate.Alpha},
114-
ExternalResourceGC: {Default: false, PreRelease: featuregate.Alpha},
115-
AlternativeGCStrategy: {Default: false, PreRelease: featuregate.Alpha},
114+
ExternalResourceGC: {Default: true, PreRelease: featuregate.Beta},
115+
AlternativeGCStrategy: {Default: false, PreRelease: featuregate.Beta},
116116
TagUnmanagedNetworkResources: {Default: true, PreRelease: featuregate.Alpha},
117117
ROSA: {Default: false, PreRelease: featuregate.Alpha},
118118
}

scripts/ci-e2e-eks-gc.sh

Lines changed: 0 additions & 112 deletions
This file was deleted.

scripts/ci-e2e-gc.sh

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)