From 802373575e5761c5012783db2f776c726b690d63 Mon Sep 17 00:00:00 2001 From: Abhishek Agarwal Date: Tue, 7 Dec 2021 12:09:29 +0530 Subject: [PATCH] update(helm): allow setting different base dir(and others) for cspc and cvc operators (#404) * Allow setting different dir path for cspc and cvc operators Signed-off-by: Abhishek Agarwal --- deploy/helm/charts/Chart.yaml | 2 +- deploy/helm/charts/README.md | 3 +++ deploy/helm/charts/templates/cspc-operator.yaml | 12 ++++++++---- deploy/helm/charts/templates/cvc-operator.yaml | 11 ++++------- deploy/helm/charts/values.yaml | 3 +++ 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/deploy/helm/charts/Chart.yaml b/deploy/helm/charts/Chart.yaml index f8c93526..cb688a72 100644 --- a/deploy/helm/charts/Chart.yaml +++ b/deploy/helm/charts/Chart.yaml @@ -4,7 +4,7 @@ description: CStor-Operator helm chart for Kubernetes type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 3.0.2 +version: 3.0.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. appVersion: 3.0.0 diff --git a/deploy/helm/charts/README.md b/deploy/helm/charts/README.md index 7fe80b7d..f25d9178 100644 --- a/deploy/helm/charts/README.md +++ b/deploy/helm/charts/README.md @@ -192,6 +192,8 @@ helm install openebs-cstor openebs-cstor/cstor --namespace openebs --create-name | cspcOperator.resyncInterval | string | `"30"` | CSPC operator resync interval | | cspcOperator.securityContext | object | `{}` | CSPC operator security context | | cspcOperator.tolerations | list | `[]` | CSPC operator pod tolerations | +| cspcOperator.baseDir | string | `"/var/openebs"` | base directory for openebs cStor pools on host path to store pool related information | +| cspcOperator.sparseDir | string | `"/var/openebs/sparse"` | sparse directory to access sparse based devices | | cstorCSIPlugin.image.pullPolicy | string | `"IfNotPresent"` | CStor CSI driver image pull policy | | cstorCSIPlugin.image.registry | string | `nil` | CStor CSI driver image registry | | cstorCSIPlugin.image.repository | string | `"openebs/cstor-csi-driver"` | CStor CSI driver image repository | @@ -220,6 +222,7 @@ helm install openebs-cstor openebs-cstor/cstor --namespace openebs --create-name | cvcOperator.volumeMgmt.image.registry | string | `nil` | Volume mgmt image registry | | cvcOperator.volumeMgmt.image.repository | string | `"openebs/cstor-volume-manager"` | Volume mgmt image repository | | cvcOperator.volumeMgmt.image.tag | string | `"3.0.0"` | Volume mgmt image tag| +| cvcOperator.baseDir | string | `"/var/openebs"` | CVC operator base directory for openebs on host path | | imagePullSecrets | string | `nil` | Image registry pull secrets | | openebsNDM.enabled | bool | `true` | Enable OpenEBS NDM dependency | | openebs-ndm.featureGates.APIService.enabled | bool | `true` | Enable 'API Service' feature gate for NDM | diff --git a/deploy/helm/charts/templates/cspc-operator.yaml b/deploy/helm/charts/templates/cspc-operator.yaml index 140929f2..7ba61d35 100644 --- a/deploy/helm/charts/templates/cspc-operator.yaml +++ b/deploy/helm/charts/templates/cspc-operator.yaml @@ -45,17 +45,21 @@ spec: valueFrom: fieldRef: fieldPath: metadata.name +{{- if .Values.cspcOperator.baseDir }} # OPENEBS_IO_BASE_DIR is used to configure base directory for openebs on host path. # Where OpenEBS can store required files. Default base path will be /var/openebs - # - name: OPENEBS_IO_BASE_DIR - # value: "/var/openebs" + - name: OPENEBS_IO_BASE_DIR + value: {{ .Values.cspcOperator.baseDir | quote }} +{{- end }} +{{- if .Values.cspcOperator.sparseDir }} # OPENEBS_IO_CSTOR_POOL_SPARSE_DIR can be used to specify the hostpath # to be used for saving the shared content between the side cars # of cstor pool pod. This ENV is also used to indicate the location # of the sparse devices. # The default path used is /var/openebs/sparse - #- name: OPENEBS_IO_CSTOR_POOL_SPARSE_DIR - # value: "/var/openebs/sparse" + - name: OPENEBS_IO_CSTOR_POOL_SPARSE_DIR + value: "{{ .Values.cspcOperator.sparseDir }}" +{{- end }} - name: OPENEBS_IO_CSPI_MGMT_IMAGE value: "{{ .Values.cspcOperator.poolManager.image.registry }}{{ .Values.cspcOperator.poolManager.image.repository }}:{{ .Values.cspcOperator.poolManager.image.tag }}" - name: OPENEBS_IO_CSTOR_POOL_IMAGE diff --git a/deploy/helm/charts/templates/cvc-operator.yaml b/deploy/helm/charts/templates/cvc-operator.yaml index f1ec691f..22cd81c4 100644 --- a/deploy/helm/charts/templates/cvc-operator.yaml +++ b/deploy/helm/charts/templates/cvc-operator.yaml @@ -34,15 +34,12 @@ spec: resources: {{ toYaml .Values.cvcOperator.resources | indent 12 }} env: +{{- if .Values.cvcOperator.baseDir }} # OPENEBS_IO_BASE_DIR is used to configure base directory for openebs on host path. # Where OpenEBS can store required files. Default base path will be /var/openebs - # - name: OPENEBS_IO_BASE_DIR - # value: "/var/openebs" - # OPENEBS_IO_CSTOR_TARGET_DIR can be used to specify the hostpath - # that to be used for saving the core dump of cstor volume pod. - # The default path used is /var/openebs/sparse - #- name: OPENEBS_IO_CSTOR_TARGET_DIR - # value: "/var/openebs/sparse" + - name: OPENEBS_IO_BASE_DIR + value: "{{ .Values.cvcOperator.baseDir }}" +{{- end }} - name: OPENEBS_NAMESPACE valueFrom: fieldRef: diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index ea207685..e73f0c7b 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -51,6 +51,8 @@ cspcOperator: tolerations: [] resources: {} securityContext: {} + baseDir: "/var/openebs" + sparseDir: "/var/openebs/sparse" cvcOperator: componentName: cvc-operator @@ -85,6 +87,7 @@ cvcOperator: tolerations: [] resources: {} securityContext: {} + baseDir: "/var/openebs" logLevel: "2" csiController: