Skip to content

Commit

Permalink
Add cleanup finalizer for aws/azure standalone templates
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Pavlov <[email protected]>
  • Loading branch information
Kshatrix committed Dec 10, 2024
1 parent 5787bc9 commit ea58805
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ spec:
iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io
instanceType: ""
workersNumber: 2
template: aws-standalone-cp-0-0-3
template: aws-standalone-cp-0-0-4
credential: aws-credential
dryRun: true
```
Expand All @@ -235,7 +235,7 @@ metadata:
name: aws-standalone
namespace: hmc-system
spec:
template: aws-standalone-cp-0-0-3
template: aws-standalone-cp-0-0-4
credential: aws-credential
config:
region: us-east-2
Expand Down
2 changes: 1 addition & 1 deletion config/dev/aws-managedcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: aws-dev
namespace: ${NAMESPACE}
spec:
template: aws-standalone-cp-0-0-3
template: aws-standalone-cp-0-0-4
credential: aws-cluster-identity-cred
config:
controlPlane:
Expand Down
2 changes: 1 addition & 1 deletion config/dev/azure-managedcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: azure-dev
namespace: ${NAMESPACE}
spec:
template: azure-standalone-cp-0-0-3
template: azure-standalone-cp-0-0-4
credential: azure-cluster-identity-cred
config:
controlPlaneNumber: 1
Expand Down
2 changes: 1 addition & 1 deletion templates/cluster/aws-standalone-cp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.3
version: 0.0.4
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand Down
2 changes: 2 additions & 0 deletions templates/cluster/aws-standalone-cp/templates/awscluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ metadata:
name: {{ include "cluster.name" . }}
annotations:
aws.cluster.x-k8s.io/external-resource-gc: "true"
finalizers:
- hmc.mirantis.com/cleanup
spec:
region: {{ .Values.region }}
identityRef:
Expand Down
2 changes: 1 addition & 1 deletion templates/cluster/azure-standalone-cp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.3
version: 0.0.4
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AzureCluster
metadata:
name: {{ include "cluster.name" . }}
finalizers:
- hmc.mirantis.com/cleanup
spec:
{{- with .Values.clusterIdentity }}
identityRef:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: hmc.mirantis.com/v1alpha1
kind: ClusterTemplate
metadata:
name: aws-standalone-cp-0-0-3
name: aws-standalone-cp-0-0-4
annotations:
helm.sh/resource-policy: keep
spec:
helm:
chartName: aws-standalone-cp
chartVersion: 0.0.3
chartVersion: 0.0.4
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: hmc.mirantis.com/v1alpha1
kind: ClusterTemplate
metadata:
name: azure-standalone-cp-0-0-3
name: azure-standalone-cp-0-0-4
annotations:
helm.sh/resource-policy: keep
spec:
helm:
chartName: azure-standalone-cp
chartVersion: 0.0.3
chartVersion: 0.0.4
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ManagedCluster
metadata:
name: ${MANAGED_CLUSTER_NAME}
spec:
template: aws-standalone-cp-0-0-3
template: aws-standalone-cp-0-0-4
credential: ${AWS_CLUSTER_IDENTITY}-cred
config:
clusterIdentity:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: ${MANAGED_CLUSTER_NAME}
namespace: ${NAMESPACE}
spec:
template: azure-standalone-cp-0-0-3
template: azure-standalone-cp-0-0-4
credential: ${AZURE_CLUSTER_IDENTITY}-cred
config:
controlPlaneNumber: 1
Expand Down

0 comments on commit ea58805

Please sign in to comment.