Properly disable platform-integ-apps charts

Pods were not being deleted when rbd-provisioner or cephfs-provisioner
charts are disabled and then reapplied the app.
We needed to add new value in helm.sh/hook annotation on deployment
resource to delete pods when chart is disabled and then reapplied
platform-integ-apps.

Test Plan:
PASS: Apply platform-integ-apps, disable rbd-provisioner chart,
then reapply App and Check if chart related pods, FluxCD helmrelease
and helm release are all removed.
PASS: Apply platform-integ-apps, disable cephfs-provisioner chart,
then reapply App and Check if chart related pods, FluxCD helmrelease
and helm release are all removed.

Closes-Bug: #2029496

Change-Id: Ie4353cab3cf93abf362dc1e55265d4eb6a9d017e
Signed-off-by: Gustavo Ornaghi Antunes <gustavo.ornaghiantunes@windriver.com>
This commit is contained in:
Gustavo Ornaghi Antunes 2023-08-03 11:47:23 -03:00 committed by gustavo ornaghi antunes
parent a832208a85
commit 5d3806316f
2 changed files with 13 additions and 11 deletions

View File

@ -1,16 +1,17 @@
From 3636dd3743e4d03394576464132d3df005c41848 Mon Sep 17 00:00:00 2001
From: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Date: Mon, 20 Mar 2023 17:37:28 -0300
From e0afca6467c6986ca8f6f1facbc6859a3c42ecf5 Mon Sep 17 00:00:00 2001
From: Gustavo Ornaghi Antunes <gustavo.ornaghiantunes@windriver.com>
Date: Fri, 04 Aug 2023 10:20:51 -0300
Subject: [PATCH] ceph-csi-cephfs: add annotations to provisioner-deployment.yaml
Signed-off-by: Hediberto Cavalcante da Silva <hediberto.cavalcantedasilva@windriver.com>
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Signed-off-by: Gustavo Ornaghi Antunes <gustavo.ornaghiantunes@windriver.com>
---
charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml
index 13c083aba..462ee6aaa 100644
index dcc15ee..2d7c815 100644
--- a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml
+++ b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml
@@ -10,6 +10,9 @@ metadata:
@ -18,12 +19,12 @@ index 13c083aba..462ee6aaa 100644
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
+ annotations:
+ "helm.sh/hook": "post-upgrade, post-install"
+ "helm.sh/hook": "post-upgrade, post-install, post-delete"
+ "helm.sh/hook-delete-policy": "before-hook-creation"
spec:
replicas: {{ .Values.provisioner.replicaCount }}
strategy:
@@ -86,7 +89,7 @@ spec:
@@ -98,7 +101,7 @@ spec:
- "--v={{ .Values.sidecarLogLevel }}"
- "--timeout={{ .Values.provisioner.timeout }}"
- "--leader-election=true"

View File

@ -1,16 +1,17 @@
From a23aa2ccc5e14f8cc2abcd17c2e0e97891f1c2cb Mon Sep 17 00:00:00 2001
From: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Date: Mon, 20 Mar 2023 17:44:46 -0300
From fbb1dd8e7d2e35f59d47c5903ce638932fb20f55 Mon Sep 17 00:00:00 2001
From: Gustavo Ornaghi Antunes <gustavo.ornaghiantunes@windriver.com>
Date: Fri, 04 Aug 2023 10:20:51 -0300
Subject: [PATCH] ceph-csi-rbd: add annotations to provisioner-deployment.yaml
Signed-off-by: Hediberto Cavalcante da Silva <hediberto.cavalcantedasilva@windriver.com>
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Signed-off-by: Gustavo Ornaghi Antunes <gustavo.ornaghiantunes@windriver.com>
---
charts/ceph-csi-rbd/templates/provisioner-deployment.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml
index fc1f28cdf..b9903f666 100644
index 824377a..f31b5d6 100644
--- a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml
+++ b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml
@@ -10,6 +10,9 @@ metadata:
@ -18,7 +19,7 @@ index fc1f28cdf..b9903f666 100644
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
+ annotations:
+ "helm.sh/hook": "post-upgrade, post-install"
+ "helm.sh/hook": "post-upgrade, post-install, post-delete"
+ "helm.sh/hook-delete-policy": "before-hook-creation"
spec:
replicas: {{ .Values.provisioner.replicaCount }}