From a1f43af01e551fb01d47bfe818c248fde9397855 Mon Sep 17 00:00:00 2001 From: w3aman Date: Thu, 2 May 2024 18:36:11 +0530 Subject: [PATCH 1/6] using custom template function Signed-off-by: w3aman --- deploy/helm/charts/templates/_helpers.tpl | 7 +++++++ deploy/helm/charts/templates/zfs-node.yaml | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/deploy/helm/charts/templates/_helpers.tpl b/deploy/helm/charts/templates/_helpers.tpl index 5c31df34..3069508a 100644 --- a/deploy/helm/charts/templates/_helpers.tpl +++ b/deploy/helm/charts/templates/_helpers.tpl @@ -146,4 +146,11 @@ Enable zfsController containers leader election if replicas > 1 - "--leader-election" {{- end }} {{- end }} +{{- end }} + +{{/* +Ensure that the path to kubelet ends with a slash +*/}} +{{- define "zfslocalpv.zfsNode.kubeletDir" -}} +{{- printf "%s/" (.Values.lvmNode.kubeletDir | trimSuffix "/") -}} {{- end }} \ No newline at end of file diff --git a/deploy/helm/charts/templates/zfs-node.yaml b/deploy/helm/charts/templates/zfs-node.yaml index 74859dd7..bbe30240 100644 --- a/deploy/helm/charts/templates/zfs-node.yaml +++ b/deploy/helm/charts/templates/zfs-node.yaml @@ -55,7 +55,7 @@ spec: - name: ADDRESS value: /plugin/csi.sock - name: DRIVER_REG_SOCK_PATH - value: {{ .Values.zfsNode.kubeletDir }}plugins/zfs-localpv/csi.sock + value: {{ printf "%s%s" (include "zfslocalpv.zfsNode.kubeletDir" .) "plugins/zfs-localpv/csi.sock" | quote }} - name: KUBE_NODE_NAME valueFrom: fieldRef: @@ -107,7 +107,11 @@ spec: mountPropagation: "HostToContainer" readOnly: true - name: pods-mount-dir +<<<<<<< HEAD mountPath: {{ .Values.zfsNode.kubeletDir }} +======= + mountPath: {{ include "zfslocalpv.zfsNode.kubeletDir" . | quote }} +>>>>>>> 7d2a4f5 (using custom template function) # needed so that any mounts setup inside this container are # propagated back to the host machine. mountPropagation: "Bidirectional" @@ -130,6 +134,7 @@ spec: type: Directory - name: registration-dir hostPath: +<<<<<<< HEAD path: {{ .Values.zfsNode.kubeletDir }}plugins_registry/ type: DirectoryOrCreate - name: plugin-dir @@ -139,6 +144,17 @@ spec: - name: pods-mount-dir hostPath: path: {{ .Values.zfsNode.kubeletDir }} +======= + path: {{ printf "%s%s" (include "zfslocalpv.zfsNode.kubeletDir" .) "plugins_registry/" | quote }} + type: DirectoryOrCreate + - name: plugin-dir + hostPath: + path: {{ printf "%s%s" (include "zfslocalpv.zfsNode.kubeletDir" .) "plugins/zfs-localpv/" | quote }} + type: DirectoryOrCreate + - name: pods-mount-dir + hostPath: + path: {{ include "zfslocalpv.zfsNode.kubeletDir" . | quote }} +>>>>>>> 7d2a4f5 (using custom template function) type: Directory {{- if .Values.zfsNode.additionalVolumes }} {{- range $name, $config := .Values.zfsNode.additionalVolumes }} From b90080f8e920da2273b0530273b3332f13f90138 Mon Sep 17 00:00:00 2001 From: w3aman Date: Thu, 2 May 2024 17:55:49 +0530 Subject: [PATCH 2/6] fix(path): handle trailing slash (/) in kubelet directory Signed-off-by: w3aman --- deploy/helm/charts/templates/zfs-node.yaml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/deploy/helm/charts/templates/zfs-node.yaml b/deploy/helm/charts/templates/zfs-node.yaml index bbe30240..9755d7ad 100644 --- a/deploy/helm/charts/templates/zfs-node.yaml +++ b/deploy/helm/charts/templates/zfs-node.yaml @@ -107,11 +107,7 @@ spec: mountPropagation: "HostToContainer" readOnly: true - name: pods-mount-dir -<<<<<<< HEAD - mountPath: {{ .Values.zfsNode.kubeletDir }} -======= mountPath: {{ include "zfslocalpv.zfsNode.kubeletDir" . | quote }} ->>>>>>> 7d2a4f5 (using custom template function) # needed so that any mounts setup inside this container are # propagated back to the host machine. mountPropagation: "Bidirectional" @@ -134,17 +130,6 @@ spec: type: Directory - name: registration-dir hostPath: -<<<<<<< HEAD - path: {{ .Values.zfsNode.kubeletDir }}plugins_registry/ - type: DirectoryOrCreate - - name: plugin-dir - hostPath: - path: {{ .Values.zfsNode.kubeletDir }}plugins/zfs-localpv/ - type: DirectoryOrCreate - - name: pods-mount-dir - hostPath: - path: {{ .Values.zfsNode.kubeletDir }} -======= path: {{ printf "%s%s" (include "zfslocalpv.zfsNode.kubeletDir" .) "plugins_registry/" | quote }} type: DirectoryOrCreate - name: plugin-dir @@ -154,7 +139,6 @@ spec: - name: pods-mount-dir hostPath: path: {{ include "zfslocalpv.zfsNode.kubeletDir" . | quote }} ->>>>>>> 7d2a4f5 (using custom template function) type: Directory {{- if .Values.zfsNode.additionalVolumes }} {{- range $name, $config := .Values.zfsNode.additionalVolumes }} From ea5fdb4de9e1cd74954819e592fe90e2c76d0b7a Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Wed, 3 Jul 2024 11:46:32 +0000 Subject: [PATCH 3/6] chore: prepare charts for release 2.6.0 Signed-off-by: Abhinandan Purkait --- deploy/helm/charts/Chart.yaml | 6 +++--- deploy/helm/charts/charts/crds/Chart.yaml | 2 +- deploy/helm/charts/charts/crds/templates/_helpers.tpl | 2 +- deploy/helm/charts/templates/_helpers.tpl | 2 +- deploy/helm/charts/values.yaml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/deploy/helm/charts/Chart.yaml b/deploy/helm/charts/Chart.yaml index a6b13080..208e134b 100644 --- a/deploy/helm/charts/Chart.yaml +++ b/deploy/helm/charts/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: zfs-localpv description: Helm chart for CSI Driver for dynamic provisioning of ZFS Persistent Local Volumes. For instructions on how to use this helm chart, see - https://openebs.github.io/zfs-localpv/ -version: 2.5.1 -appVersion: 2.5.0 +version: 2.6.0 +appVersion: 2.6.0 icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png home: https://openebs.io/ keywords: @@ -16,5 +16,5 @@ sources: - https://github.com/openebs/zfs-localpv dependencies: - name: crds - version: 2.5.1 + version: 2.6.0 condition: crds.enabled diff --git a/deploy/helm/charts/charts/crds/Chart.yaml b/deploy/helm/charts/charts/crds/Chart.yaml index 475b02d2..7fec4212 100644 --- a/deploy/helm/charts/charts/crds/Chart.yaml +++ b/deploy/helm/charts/charts/crds/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v2 name: crds -version: 2.5.1 +version: 2.6.0 description: A Helm chart that collects CustomResourceDefinitions (CRDs) from zfs-localpv. diff --git a/deploy/helm/charts/charts/crds/templates/_helpers.tpl b/deploy/helm/charts/charts/crds/templates/_helpers.tpl index 68045e1c..6b2cbf14 100644 --- a/deploy/helm/charts/charts/crds/templates/_helpers.tpl +++ b/deploy/helm/charts/charts/crds/templates/_helpers.tpl @@ -16,4 +16,4 @@ helm.sh/resource-policy: keep {{- with .annotations }} {{- toYaml . }} {{- end }} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/deploy/helm/charts/templates/_helpers.tpl b/deploy/helm/charts/templates/_helpers.tpl index 3069508a..fae4e924 100644 --- a/deploy/helm/charts/templates/_helpers.tpl +++ b/deploy/helm/charts/templates/_helpers.tpl @@ -153,4 +153,4 @@ Ensure that the path to kubelet ends with a slash */}} {{- define "zfslocalpv.zfsNode.kubeletDir" -}} {{- printf "%s/" (.Values.lvmNode.kubeletDir | trimSuffix "/") -}} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index 86e5c717..7dc0f5ef 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -2,7 +2,7 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. release: - version: "2.5.1" + version: "2.6.0" imagePullSecrets: # - name: "image-pull-secret" @@ -146,7 +146,7 @@ zfsPlugin: repository: openebs/zfs-driver pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: 2.5.0 + tag: 2.6.0 role: openebs-zfs From a227ccb6a89734f0d035d012197f1f6d53f398cd Mon Sep 17 00:00:00 2001 From: w3aman Date: Thu, 2 May 2024 18:36:11 +0530 Subject: [PATCH 4/6] using custom template function Signed-off-by: w3aman --- deploy/helm/charts/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/helm/charts/templates/_helpers.tpl b/deploy/helm/charts/templates/_helpers.tpl index fae4e924..66b8dcfa 100644 --- a/deploy/helm/charts/templates/_helpers.tpl +++ b/deploy/helm/charts/templates/_helpers.tpl @@ -152,5 +152,5 @@ Enable zfsController containers leader election if replicas > 1 Ensure that the path to kubelet ends with a slash */}} {{- define "zfslocalpv.zfsNode.kubeletDir" -}} -{{- printf "%s/" (.Values.lvmNode.kubeletDir | trimSuffix "/") -}} +{{- printf "%s/" (.Values.zfsNode.kubeletDir | trimSuffix "/") -}} {{- end }} From 3a4d841cbb85d4d7404b724ac58465c7bc4018e9 Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Wed, 3 Jul 2024 13:33:58 +0000 Subject: [PATCH 5/6] feat(helm): remove anti-affinity from the zfs controller Signed-off-by: Abhinandan Purkait --- deploy/helm/charts/templates/zfs-controller.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/deploy/helm/charts/templates/zfs-controller.yaml b/deploy/helm/charts/templates/zfs-controller.yaml index 1a6b5af5..3efc477c 100644 --- a/deploy/helm/charts/templates/zfs-controller.yaml +++ b/deploy/helm/charts/templates/zfs-controller.yaml @@ -24,16 +24,6 @@ spec: {{ toYaml . | nindent 8 }} {{- end}} spec: - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - openebs-zfs-controller - topologyKey: "kubernetes.io/hostname" {{- if .Values.zfsController.priorityClass.create }} priorityClassName: {{ template "zfslocalpv.zfsController.priorityClassName" . }} {{- end }} From 700b85ae7470b3c3fb6d704baea8ba35755ef10f Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Thu, 4 Jul 2024 05:58:14 +0000 Subject: [PATCH 6/6] docs(README): update the version in chart README Signed-off-by: Abhinandan Purkait --- deploy/helm/charts/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/helm/charts/README.md b/deploy/helm/charts/README.md index d03f544f..56c5e011 100644 --- a/deploy/helm/charts/README.md +++ b/deploy/helm/charts/README.md @@ -69,7 +69,7 @@ The following table lists the configurable parameters of the OpenEBS ZFS Localpv | `zfsPlugin.image.registry`| Registry for openebs-zfs-plugin image| `""`| | `zfsPlugin.image.repository`| Image repository for openebs-zfs-plugin| `openebs/zfs-driver`| | `zfsPlugin.image.pullPolicy`| Image pull policy for openebs-zfs-plugin| `IfNotPresent`| -| `zfsPlugin.image.tag`| Image tag for openebs-zfs-plugin| `2.5.0`| +| `zfsPlugin.image.tag`| Image tag for openebs-zfs-plugin| `2.6.0`| | `zfsNode.allowedTopologyKeys`| Custom topology keys required for provisioning| `"kubernetes.io/hostname,"`| | `zfsNode.driverRegistrar.image.registry`| Registry for csi-node-driver-registrar image| `registry.k8s.io/`| | `zfsNode.driverRegistrar.image.repository`| Image repository for csi-node-driver-registrar| `sig-storage/csi-node-driver-registrar`|