Add "checksum/config" annotation to nodeplugin-daemonset

With the mgmt network reconfiguration, the 'cephfs-nodeplugin'
and 'rbd-nodeplugin' pods don't recognize the change and are
not automatically restarted.

To resolve this, an annotation was added to each
nodeplugin-daemonset.yaml, monitoring any changes to
csiConfig values.

$ kubectl get configmaps -n kube-system cephfs-csiplugin-config -o yaml
apiVersion: v1
data:
  config.json: '[{"clusterID":"e36fa26b-bdd5-42a5-83b3-c36a4042109b",
  "monitors":["192.168.204.2:6789"]}]'
kind: ConfigMap
...

----------------------------------------------------------------------

$ kubectl get configmaps -n kube-system cephfs-csiplugin-config -o yaml
apiVersion: v1
data:
  config.json: '[{"clusterID":"e36fa26b-bdd5-42a5-83b3-c36a4042109b",
  "monitors":["192.168.208.3:6789"]}]'
kind: ConfigMap
...

As can be seen above, the monitor is modified after reconfiguration.
This information is obtained through Values.csiConfig in
csiplugin-configmap template:

data:
  config.json: |-
{{ toJson .Values.csiConfig | indent 4 -}}

Test Plan:
  - PASS: Create pod on AIO-SX with ceph backend
  - PASS: Reconfiguration of the mgmt network
  - PASS: Check if the previously created pod is running

Story: 2010722
Task: 49295

Change-Id: I9892f1ba7127fe381cba5727e34d16803f93b5bf
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
This commit is contained in:
Erickson Silva de Oliveira 2023-12-18 21:33:22 -03:00
parent 718d56a3d6
commit 5255e744eb
3 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,28 @@
From 0fc30cb3def093b274b1646b4ddb8e633cddb19e Mon Sep 17 00:00:00 2001
From: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Date: Mon, 18 Dec 2023 19:54:53 -0300
Subject: [PATCH] ceph-csi-rbd: add annotations to nodeplugin-daemonset.yaml
Support MGMT reconfiguration, restarting the rbd-nodeplugin pod
when an IP change occurs.
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
---
charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml b/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml
index a1744a895..f0dcea15a 100644
--- a/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml
+++ b/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml
@@ -20,6 +20,8 @@ spec:
type: {{ .Values.nodeplugin.updateStrategy }}
template:
metadata:
+ annotations:
+ checksum/config: {{ tpl (toYaml .Values.csiConfig) . | sha256sum }}
labels:
app: {{ include "ceph-csi-rbd.name" . }}
chart: {{ include "ceph-csi-rbd.chart" . }}
--
2.34.1

View File

@ -0,0 +1,28 @@
From 01f3f9ed470e0cc3b235e56ddfaf86f598fbd6db Mon Sep 17 00:00:00 2001
From: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Date: Mon, 18 Dec 2023 19:56:05 -0300
Subject: [PATCH] ceph-csi-cephfs: add annotations to nodeplugin-daemonset.yaml
Support MGMT reconfiguration, restarting the cephfs-nodeplugin pod
when an IP change occurs.
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
---
charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml b/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml
index d3a5b9df8..dcf52f5e2 100644
--- a/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml
+++ b/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml
@@ -20,6 +20,8 @@ spec:
type: {{ .Values.nodeplugin.updateStrategy }}
template:
metadata:
+ annotations:
+ checksum/config: {{ tpl (toYaml .Values.csiConfig) . | sha256sum }}
labels:
app: {{ include "ceph-csi-cephfs.name" . }}
chart: {{ include "ceph-csi-cephfs.chart" . }}
--
2.34.1

View File

@ -10,3 +10,5 @@
0010-ceph-csi-rbd-add-annotations-to-provisioner-deployment.patch
0011-ceph-csi-rbd-update-storageclass.patch
0012-ceph-csi-cephfs-update-storageclass.patch
0013-ceph-csi-rbd-add-annotations-to-nodeplugin-daemonset.patch
0014-ceph-csi-cephfs-add-annotations-to-nodeplugin-daemonset.patch