diff --git a/charts/cluster-addons/templates/cni/calico.yaml b/charts/cluster-addons/templates/cni/calico.yaml index 1a48ab1..89ae3cd 100644 --- a/charts/cluster-addons/templates/cni/calico.yaml +++ b/charts/cluster-addons/templates/cni/calico.yaml @@ -34,6 +34,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "cni-calico") }} labels: {{ include "cluster-addons.componentLabels" (list . "cni-calico") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/cni/cilium.yaml b/charts/cluster-addons/templates/cni/cilium.yaml index 4325b45..47e5aee 100644 --- a/charts/cluster-addons/templates/cni/cilium.yaml +++ b/charts/cluster-addons/templates/cni/cilium.yaml @@ -49,6 +49,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "cni-cilium") }} labels: {{ include "cluster-addons.componentLabels" (list . "cni-cilium") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/custom-addons.yaml b/charts/cluster-addons/templates/custom-addons.yaml index dcde8a9..ec9b251 100644 --- a/charts/cluster-addons/templates/custom-addons.yaml +++ b/charts/cluster-addons/templates/custom-addons.yaml @@ -20,6 +20,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list $ $name) }} labels: {{ include "cluster-addons.componentLabels" (list $ $name) | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" $ }} bootstrap: true @@ -53,6 +56,9 @@ kind: Manifests metadata: name: {{ include "cluster-addons.componentName" (list $ $name) }} labels: {{ include "cluster-addons.componentLabels" (list $ $name) | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" $ }} bootstrap: true diff --git a/charts/cluster-addons/templates/ingress-nginx.yaml b/charts/cluster-addons/templates/ingress-nginx.yaml index a55fd0c..3960e17 100644 --- a/charts/cluster-addons/templates/ingress-nginx.yaml +++ b/charts/cluster-addons/templates/ingress-nginx.yaml @@ -27,6 +27,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "ingress-nginx") }} labels: {{ include "cluster-addons.componentLabels" (list . "ingress-nginx") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/kubernetes-dashboard.yaml b/charts/cluster-addons/templates/kubernetes-dashboard.yaml index 0b64e19..cdbf685 100644 --- a/charts/cluster-addons/templates/kubernetes-dashboard.yaml +++ b/charts/cluster-addons/templates/kubernetes-dashboard.yaml @@ -24,6 +24,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "kubernetes-dashboard") }} labels: {{ include "cluster-addons.componentLabels" (list . "kubernetes-dashboard") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/mellanox-network-operator.yaml b/charts/cluster-addons/templates/mellanox-network-operator.yaml index db23381..9997aaf 100644 --- a/charts/cluster-addons/templates/mellanox-network-operator.yaml +++ b/charts/cluster-addons/templates/mellanox-network-operator.yaml @@ -61,13 +61,15 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "mellanox-network-operator") }} labels: {{ include "cluster-addons.componentLabels" (list . "mellanox-network-operator") | nindent 4 }} - # When using the Argo addon provider, we want to use kubectl apply - # This is because some of the resources fail to validate when using server-side apply - # See https://github.com/Mellanox/network-operator/issues/452 - # - # We use the annotation rather than the spec so that the resource is compatible with - # both the legacy and Argo addon providers annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" + # When using the Argo addon provider, we want to use regular apply for the generated app + # This is because some of the resources fail to validate when using server-side apply + # See https://github.com/Mellanox/network-operator/issues/452 + # + # We use the annotation rather than the spec so that the resource is compatible with + # both the legacy and Argo addon providers addons.stackhpc.com/sync-options: | { "serverSideApply": false } spec: diff --git a/charts/cluster-addons/templates/metrics-server.yaml b/charts/cluster-addons/templates/metrics-server.yaml index 568cfe7..832818c 100644 --- a/charts/cluster-addons/templates/metrics-server.yaml +++ b/charts/cluster-addons/templates/metrics-server.yaml @@ -21,6 +21,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "metrics-server") }} labels: {{ include "cluster-addons.componentLabels" (list . "metrics-server") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/monitoring/kube-prometheus-stack.yaml b/charts/cluster-addons/templates/monitoring/kube-prometheus-stack.yaml index 5b69c09..fb801c4 100644 --- a/charts/cluster-addons/templates/monitoring/kube-prometheus-stack.yaml +++ b/charts/cluster-addons/templates/monitoring/kube-prometheus-stack.yaml @@ -61,6 +61,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "kube-prometheus-stack") }} labels: {{ include "cluster-addons.componentLabels" (list . "kube-prometheus-stack") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true @@ -80,6 +83,9 @@ kind: Manifests metadata: name: {{ include "cluster-addons.componentName" (list . "kube-prometheus-stack-dashboards") }} labels: {{ include "cluster-addons.componentLabels" (list . "kube-prometheus-stack-dashboards") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/monitoring/loki-stack.yaml b/charts/cluster-addons/templates/monitoring/loki-stack.yaml index 73db70d..2ae29c2 100644 --- a/charts/cluster-addons/templates/monitoring/loki-stack.yaml +++ b/charts/cluster-addons/templates/monitoring/loki-stack.yaml @@ -27,6 +27,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "loki-stack") }} labels: {{ include "cluster-addons.componentLabels" (list . "loki-stack") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true @@ -46,6 +49,9 @@ kind: Manifests metadata: name: {{ include "cluster-addons.componentName" (list . "loki-stack-dashboards") }} labels: {{ include "cluster-addons.componentLabels" (list . "loki-stack-dashboards") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/nfd.yaml b/charts/cluster-addons/templates/nfd.yaml index e36a0d0..fca6be4 100644 --- a/charts/cluster-addons/templates/nfd.yaml +++ b/charts/cluster-addons/templates/nfd.yaml @@ -48,6 +48,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "node-feature-discovery") }} labels: {{ include "cluster-addons.componentLabels" (list . "node-feature-discovery") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/nvidia-gpu-operator.yaml b/charts/cluster-addons/templates/nvidia-gpu-operator.yaml index 0a47a6b..8a0fca4 100644 --- a/charts/cluster-addons/templates/nvidia-gpu-operator.yaml +++ b/charts/cluster-addons/templates/nvidia-gpu-operator.yaml @@ -71,13 +71,15 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "nvidia-gpu-operator") }} labels: {{ include "cluster-addons.componentLabels" (list . "nvidia-gpu-operator") | nindent 4 }} - # When using the Argo addon provider, we want to use kubectl apply - # This is because some of the resources fail to validate when using server-side apply - # See https://github.com/NVIDIA/gpu-operator/issues/478 - # - # We use the annotation rather than the spec so that the resource is compatible with - # both the legacy and Argo addon providers annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" + # When using the Argo addon provider, we want to use kubectl apply + # This is because some of the resources fail to validate when using server-side apply + # See https://github.com/NVIDIA/gpu-operator/issues/478 + # + # We use the annotation rather than the spec so that the resource is compatible with + # both the legacy and Argo addon providers addons.stackhpc.com/sync-options: | { "serverSideApply": false } spec: diff --git a/charts/cluster-addons/templates/openstack/ccm.yaml b/charts/cluster-addons/templates/openstack/ccm.yaml index 6cf4b34..2c8bae6 100644 --- a/charts/cluster-addons/templates/openstack/ccm.yaml +++ b/charts/cluster-addons/templates/openstack/ccm.yaml @@ -35,6 +35,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "ccm-openstack") }} labels: {{ include "cluster-addons.componentLabels" (list . "ccm-openstack") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/openstack/cloud-config.yaml b/charts/cluster-addons/templates/openstack/cloud-config.yaml index 7fd906e..64863cd 100644 --- a/charts/cluster-addons/templates/openstack/cloud-config.yaml +++ b/charts/cluster-addons/templates/openstack/cloud-config.yaml @@ -5,6 +5,9 @@ kind: Manifests metadata: name: {{ include "cluster-addons.componentName" (list . "cloud-config") }} labels: {{ include "cluster-addons.componentLabels" (list . "cloud-config") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/cluster-addons/templates/openstack/csi-cinder.yaml b/charts/cluster-addons/templates/openstack/csi-cinder.yaml index d95a333..0f8e939 100644 --- a/charts/cluster-addons/templates/openstack/csi-cinder.yaml +++ b/charts/cluster-addons/templates/openstack/csi-cinder.yaml @@ -62,6 +62,9 @@ kind: HelmRelease metadata: name: {{ include "cluster-addons.componentName" (list . "csi-cinder") }} labels: {{ include "cluster-addons.componentLabels" (list . "csi-cinder") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true @@ -82,6 +85,9 @@ kind: Manifests metadata: name: {{ include "cluster-addons.componentName" (list . "csi-cinder-storageclass") }} labels: {{ include "cluster-addons.componentLabels" (list . "csi-cinder-storageclass") | nindent 4 }} + annotations: + # Tell Argo to ignore the non-controller owner references for this object + argocd.argoproj.io/sync-options: "ControllerReferencesOnly=true" spec: clusterName: {{ include "cluster-addons.clusterName" . }} bootstrap: true diff --git a/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml b/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml index aa5dcac..21350fa 100644 --- a/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml +++ b/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml @@ -50,6 +50,7 @@ metadata: # Cluster API complains when old templates disappear before it has rolled all the machines over # When deploying with Helm, leave the resource behind and let Cluster API clean it up helm.sh/resource-policy: keep - # NOTE: Argo won't delete this object itself as it has an owner reference to the cluster + # Allow Argo to clean up old templates after the cluster has become healthy again + argocd.argoproj.io/sync-options: PruneLast=true spec: {{- include "openstack-cluster.controlplane.mt.spec" . | nindent 2 }} diff --git a/charts/openstack-cluster/templates/node-group/kubeadm-config-template.yaml b/charts/openstack-cluster/templates/node-group/kubeadm-config-template.yaml index 165b19d..35b3a5c 100644 --- a/charts/openstack-cluster/templates/node-group/kubeadm-config-template.yaml +++ b/charts/openstack-cluster/templates/node-group/kubeadm-config-template.yaml @@ -43,7 +43,8 @@ metadata: # Cluster API complains when old templates disappear before it has rolled all the machines over # When deploying with Helm, leave the resource behind and let Cluster API clean it up helm.sh/resource-policy: keep - # NOTE: Argo won't delete this object itself as it has an owner reference to the cluster + # Allow Argo to clean up old templates after the cluster has become healthy again + argocd.argoproj.io/sync-options: PruneLast=true spec: template: spec: {{ include "openstack-cluster.nodegroup.kct.spec" (list $ $nodeGroup) | nindent 6 }} diff --git a/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml b/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml index aebdfa0..d07181d 100644 --- a/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml +++ b/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml @@ -59,6 +59,7 @@ metadata: # Cluster API complains when old templates disappear before it has rolled all the machines over # When deploying with Helm, leave the resource behind and let Cluster API clean it up helm.sh/resource-policy: keep - # NOTE: Argo won't delete this object itself as it has an owner reference to the cluster + # Allow Argo to clean up old templates after the cluster has become healthy again + argocd.argoproj.io/sync-options: PruneLast=true spec: {{ include "openstack-cluster.nodegroup.mt.spec" (list $ $nodeGroup) | nindent 2 }} {{- end }}