Let CAPI rather than Helm manage the deletion of CAPI resources
This commit is contained in:
parent
a0bcee539f
commit
e158efd21e
@ -4,6 +4,10 @@ kind: OpenStackCluster
|
||||
metadata:
|
||||
name: {{ include "openstack-cluster.clusterName" . }}
|
||||
labels: {{ include "openstack-cluster.commonLabels" . | nindent 4 }}
|
||||
annotations:
|
||||
# We let Cluster API clean up the cluster resources
|
||||
# Deleting them ourselves, which CAPI is not expecting, can cause some nasty race conditions
|
||||
helm.sh/resource-policy: keep
|
||||
spec:
|
||||
identityRef:
|
||||
kind: Secret
|
||||
|
@ -70,6 +70,10 @@ kind: KubeadmControlPlane
|
||||
metadata:
|
||||
name: {{ include "openstack-cluster.componentName" (list . "control-plane") }}
|
||||
labels: {{ include "openstack-cluster.componentLabels" (list . "control-plane") | nindent 4 }}
|
||||
annotations:
|
||||
# We let Cluster API clean up the cluster resources
|
||||
# Deleting them ourselves, which CAPI is not expecting, can cause some nasty race conditions
|
||||
helm.sh/resource-policy: keep
|
||||
spec:
|
||||
version: {{ .Values.global.kubernetesVersion | required ".Values.global.kubernetesVersion is required" }}
|
||||
replicas: {{ .Values.controlPlane.machineCount }}
|
||||
|
@ -5,6 +5,10 @@ kind: MachineHealthCheck
|
||||
metadata:
|
||||
name: {{ include "openstack-cluster.componentName" (list . "control-plane") }}
|
||||
labels: {{ include "openstack-cluster.componentLabels" (list . "control-plane") | nindent 4 }}
|
||||
annotations:
|
||||
# We let Cluster API clean up the cluster resources
|
||||
# Deleting them ourselves, which CAPI is not expecting, can cause some nasty race conditions
|
||||
helm.sh/resource-policy: keep
|
||||
spec:
|
||||
clusterName: {{ include "openstack-cluster.clusterName" . }}
|
||||
selector:
|
||||
|
@ -47,7 +47,8 @@ metadata:
|
||||
labels: {{ include "openstack-cluster.componentLabels" (list . "control-plane") | nindent 4 }}
|
||||
annotations:
|
||||
capi.stackhpc.com/template-checksum: {{ include "openstack-cluster.controlplane.mt.checksum" . }}
|
||||
# Ensure that the previous machine templates are kept around
|
||||
# We let Cluster API clean up the cluster resources
|
||||
# Deleting them ourselves, which CAPI is not expecting, can cause some nasty race conditions
|
||||
helm.sh/resource-policy: keep
|
||||
spec:
|
||||
{{- include "openstack-cluster.controlplane.mt.spec" . | nindent 2 }}
|
||||
|
@ -38,7 +38,8 @@ metadata:
|
||||
labels: {{ include "openstack-cluster.nodeGroupLabels" (list $ $nodeGroup.name) | nindent 4 }}
|
||||
annotations:
|
||||
capi.stackhpc.com/template-checksum: {{ include "openstack-cluster.nodegroup.kct.checksum" (list $ $nodeGroup) }}
|
||||
# Ensure that the previous templates are kept around
|
||||
# We let Cluster API clean up the cluster resources
|
||||
# Deleting them ourselves, which CAPI is not expecting, can cause some nasty race conditions
|
||||
helm.sh/resource-policy: keep
|
||||
spec:
|
||||
template:
|
||||
|
@ -6,6 +6,10 @@ kind: MachineDeployment
|
||||
metadata:
|
||||
name: {{ include "openstack-cluster.componentName" (list $ $nodeGroup.name) }}
|
||||
labels: {{ include "openstack-cluster.nodeGroupLabels" (list $ $nodeGroup.name) | nindent 4 }}
|
||||
annotations:
|
||||
# We let Cluster API clean up the cluster resources
|
||||
# Deleting them ourselves, which CAPI is not expecting, can cause some nasty race conditions
|
||||
helm.sh/resource-policy: keep
|
||||
{{- if $nodeGroup.autoscale }}
|
||||
{{-
|
||||
$machineCountMin := $nodeGroup.machineCountMin |
|
||||
@ -21,7 +25,6 @@ metadata:
|
||||
{{- if lt $machineCountMax $machineCountMin }}
|
||||
{{- fail (printf "maximum machine count < minimum machine count for node group '%s'" $nodeGroup.name) }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: {{ quote $machineCountMin }}
|
||||
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: {{ quote $machineCountMax }}
|
||||
{{- end }}
|
||||
|
@ -7,6 +7,10 @@ kind: MachineHealthCheck
|
||||
metadata:
|
||||
name: {{ include "openstack-cluster.componentName" (list $ $nodeGroup.name) }}
|
||||
labels: {{ include "openstack-cluster.nodeGroupLabels" (list $ $nodeGroup.name) | nindent 4 }}
|
||||
annotations:
|
||||
# We let Cluster API clean up the cluster resources
|
||||
# Deleting them ourselves, which CAPI is not expecting, can cause some nasty race conditions
|
||||
helm.sh/resource-policy: keep
|
||||
spec:
|
||||
clusterName: {{ include "openstack-cluster.clusterName" $ }}
|
||||
selector:
|
||||
|
@ -54,7 +54,8 @@ metadata:
|
||||
labels: {{ include "openstack-cluster.nodeGroupLabels" (list $ $nodeGroup.name) | nindent 4 }}
|
||||
annotations:
|
||||
capi.stackhpc.com/template-checksum: {{ include "openstack-cluster.nodegroup.mt.checksum" (list $ $nodeGroup) }}
|
||||
# Ensure that the previous machine templates are kept around
|
||||
# We let Cluster API clean up the cluster resources
|
||||
# Deleting them ourselves, which CAPI is not expecting, can cause some nasty race conditions
|
||||
helm.sh/resource-policy: keep
|
||||
spec: {{ include "openstack-cluster.nodegroup.mt.spec" (list $ $nodeGroup) | nindent 2 }}
|
||||
{{- end }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user