Skip to content

🌱 chore: graduate garbage collection #5348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,6 @@ test-e2e: $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) generate-test-flavors e2e-image ##
test-e2e-eks: generate-test-flavors $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks e2e tests
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)

.PHONY: test-e2e-gc ## Run garbage collection e2e tests using clusterctl
test-e2e-gc: generate-test-flavors $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks e2e tests
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)

.PHONY: test-e2e-eks-gc ## Run EKS garbage collection e2e tests using clusterctl
test-e2e-eks-gc: generate-test-flavors $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks e2e tests
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)


CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)
CONFORMANCE_GINKGO_ARGS += $(GINKGO_ARGS)
Expand All @@ -464,8 +455,6 @@ compile-e2e: ## Test e2e compilation
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/unmanaged
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/conformance
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/managed
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/gc_managed
go test -c -o /dev/null -tags=e2e ./test/e2e/suites/gc_unmanaged


.PHONY: docker-pull-e2e-preloads
Expand Down
86 changes: 43 additions & 43 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,38 @@ spec:
control-plane: capa-controller-manager
spec:
containers:
- args:
- "--leader-elect"
- "--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}"
- "--v=${CAPA_LOGLEVEL:=0}"
- "--diagnostics-address=${CAPA_DIAGNOSTICS_ADDRESS:=:8443}"
- "--insecure-diagnostics=${CAPA_INSECURE_DIAGNOSTICS:=false}"
image: controller:latest
imagePullPolicy: Always
name: manager
ports:
- containerPort: 9440
name: healthz
protocol: TCP
- containerPort: 8443
name: metrics
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: healthz
livenessProbe:
httpGet:
path: /healthz
port: healthz
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsUser: 65532
runAsGroup: 65532
terminationMessagePolicy: FallbackToLogsOnError
- args:
- "--leader-elect"
- "--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}"
- "--v=${CAPA_LOGLEVEL:=0}"
- "--diagnostics-address=${CAPA_DIAGNOSTICS_ADDRESS:=:8443}"
- "--insecure-diagnostics=${CAPA_INSECURE_DIAGNOSTICS:=false}"
image: controller:latest
imagePullPolicy: Always
name: manager
ports:
- containerPort: 9440
name: healthz
protocol: TCP
- containerPort: 8443
name: metrics
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: healthz
livenessProbe:
httpGet:
path: /healthz
port: healthz
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsUser: 65532
runAsGroup: 65532
terminationMessagePolicy: FallbackToLogsOnError
securityContext:
runAsNonRoot: true
seccompProfile:
Expand All @@ -62,15 +62,15 @@ spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
preference:
matchExpressions:
- key: ${K8S_CP_LABEL:=node-role.kubernetes.io/control-plane}
operator: Exists
# remove once usage of node-role.kubernetes.io/master is removed from Kubernetes
- weight: 10
preference:
matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
- weight: 10
preference:
matchExpressions:
- key: ${K8S_CP_LABEL:=node-role.kubernetes.io/control-plane}
operator: Exists
# remove once usage of node-role.kubernetes.io/master is removed from Kubernetes
- weight: 10
preference:
matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
serviceAccountName: manager
3 changes: 3 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#git",
"source": "nixpkg"
},
"github:NixOS/nixpkgs/nixpkgs-unstable": {
"resolved": "github:NixOS/nixpkgs/573c650e8a14b2faa0041645ab18aed7e60f0c9a?lastModified=1741865919&narHash=sha256-4thdbnP6dlbdq%2BqZWTsm4ffAwoS8Tiq1YResB%2BRP6WE%3D"
},
"[email protected]": {
"last_modified": "2024-12-23T21:10:33Z",
"resolved": "github:NixOS/nixpkgs/de1864217bfa9b5845f465e771e0ecb48b30e02d#go_1_22",
Expand Down
10 changes: 5 additions & 5 deletions docs/book/src/topics/external-resource-gc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# External Resource Garbage Collection

- **Feature status:** Experimental
- **Feature status:** Stable
- **Feature gate (required):** ExternalResourceGC=true

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

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

## Enabling
## Disabling

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:
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:

```bash
export EXP_EXTERNAL_RESOURCE_GC=true
export EXTERNAL_RESOURCE_GC=false
clusterctl init --infrastructure aws
```

> Note: if you enable this feature **ALL** clusters will be marked as requiring garbage collection.
> Note: if you disable this feature **ALL** clusters will be marked as not requiring garbage collection.

## Operations

Expand Down
4 changes: 2 additions & 2 deletions feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ var defaultCAPAFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
MachinePoolMachines: {Default: false, PreRelease: featuregate.Alpha},
AutoControllerIdentityCreator: {Default: true, PreRelease: featuregate.Alpha},
BootstrapFormatIgnition: {Default: false, PreRelease: featuregate.Alpha},
ExternalResourceGC: {Default: false, PreRelease: featuregate.Alpha},
AlternativeGCStrategy: {Default: false, PreRelease: featuregate.Alpha},
ExternalResourceGC: {Default: true, PreRelease: featuregate.Beta},
AlternativeGCStrategy: {Default: false, PreRelease: featuregate.Beta},
TagUnmanagedNetworkResources: {Default: true, PreRelease: featuregate.Alpha},
ROSA: {Default: false, PreRelease: featuregate.Alpha},
}
112 changes: 0 additions & 112 deletions scripts/ci-e2e-eks-gc.sh

This file was deleted.

112 changes: 0 additions & 112 deletions scripts/ci-e2e-gc.sh

This file was deleted.

Loading
Loading