This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ozone-helm-charts.git


The following commit(s) were added to refs/heads/main by this push:
     new aeedd29  HDDS-11597. Fix invalid accessModes with persistence enabled 
(#9)
aeedd29 is described below

commit aeedd2922351a22cefd4db01b54430122612dd48
Author: pyttel <[email protected]>
AuthorDate: Mon Oct 28 08:07:47 2024 +0100

    HDDS-11597. Fix invalid accessModes with persistence enabled (#9)
---
 charts/ozone/Chart.yaml                            |  2 +-
 charts/ozone/templates/datanode/datanode-pvc.yaml  | 34 ----------------------
 .../templates/datanode/datanode-statefulset.yaml   | 32 ++++++++++++++------
 charts/ozone/templates/om/om-pvc.yaml              | 34 ----------------------
 charts/ozone/templates/om/om-statefulset.yaml      | 32 ++++++++++++++------
 charts/ozone/templates/ozone-configmap.yaml        |  2 +-
 charts/ozone/templates/s3g/s3g-pvc.yaml            | 34 ----------------------
 charts/ozone/templates/s3g/s3g-statefulset.yaml    | 32 ++++++++++++++------
 charts/ozone/templates/scm/scm-pvc.yaml            | 34 ----------------------
 charts/ozone/templates/scm/scm-statefulset.yaml    | 34 +++++++++++++++-------
 charts/ozone/values.yaml                           | 20 ++++++++-----
 11 files changed, 107 insertions(+), 183 deletions(-)

diff --git a/charts/ozone/Chart.yaml b/charts/ozone/Chart.yaml
index 10ff904..6b8b598 100644
--- a/charts/ozone/Chart.yaml
+++ b/charts/ozone/Chart.yaml
@@ -18,7 +18,7 @@ apiVersion: v2
 name: ozone
 description: The official Helm chart for Apache Ozone
 type: application
-version: 0.1.0
+version: 0.1.1
 appVersion: "1.4.0"
 home: https://ozone.apache.org
 icon: https://ozone.apache.org/ozone-logo.png
diff --git a/charts/ozone/templates/datanode/datanode-pvc.yaml 
b/charts/ozone/templates/datanode/datanode-pvc.yaml
deleted file mode 100644
index a0995ae..0000000
--- a/charts/ozone/templates/datanode/datanode-pvc.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-{{/*
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-*/}}
-
-{{- if and .Values.datanode.persistence.enabled (not 
.Values.datanode.persistence.existingClaim) }}
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
-  name: {{ .Release.Name }}-datanode
-  labels:
-    {{- include "ozone.labels" . | nindent 4 }}
-    app.kubernetes.io/component: datanode
-spec:
-  resources:
-    requests:
-      storage: {{ .Values.datanode.persistence.size }}
-  {{- with .Values.datanode.persistence.storageClassName }}
-  storageClassName: {{ . }}
-  {{- end }}
-{{- end }}
diff --git a/charts/ozone/templates/datanode/datanode-statefulset.yaml 
b/charts/ozone/templates/datanode/datanode-statefulset.yaml
index f8eadd5..a9320d1 100644
--- a/charts/ozone/templates/datanode/datanode-statefulset.yaml
+++ b/charts/ozone/templates/datanode/datanode-statefulset.yaml
@@ -73,7 +73,7 @@ spec:
           volumeMounts:
             - name: config
               mountPath: {{ .Values.configuration.dir }}
-            - name: data
+            - name: {{ .Release.Name }}-datanode
               mountPath: {{ .Values.datanode.persistence.path }}
       {{- with $nodeSelector }}
       nodeSelector: {{- toYaml . | nindent 8 }}
@@ -92,15 +92,29 @@ spec:
           projected:
             sources:
               - configMap:
-                  name: {{ .Release.Name }}
+                  name: {{ .Release.Name }}-ozone
               {{- with .Values.configuration.filesFrom }}
-                {{- tpl (toYaml .) $ | nindent 8 }}
+                {{- tpl (toYaml .) $ | nindent 14 }}
               {{- end }}
-        {{- if .Values.datanode.persistence.enabled }}
-        - name: data
-          persistentVolumeClaim:
-            claimName: {{ .Values.datanode.persistence.existingClaim | default 
(printf "%s-%s" .Release.Name "datanode") }}
-        {{- else }}
-        - name: data
+        {{- if not .Values.datanode.persistence.enabled }}
+        - name: {{ .Release.Name }}-datanode
           emptyDir: {}
         {{- end }}
+  {{- if .Values.datanode.persistence.enabled }}
+  volumeClaimTemplates:
+    - metadata:
+        name: {{ .Release.Name }}-datanode
+        labels:
+          {{- include "ozone.labels" . | nindent 10 }}
+          app.kubernetes.io/component: datanode
+      spec:
+        {{- with .Values.datanode.persistence.accessModes }}
+        accessModes: {{- toYaml . | nindent 10 }}
+        {{- end }}
+        resources:
+          requests:
+            storage: {{ .Values.datanode.persistence.size }}
+        {{- with .Values.scm.persistence.storageClassName }}
+        storageClassName: {{ . }}
+        {{- end }}
+  {{- end }}
diff --git a/charts/ozone/templates/om/om-pvc.yaml 
b/charts/ozone/templates/om/om-pvc.yaml
deleted file mode 100644
index 24142cd..0000000
--- a/charts/ozone/templates/om/om-pvc.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-{{/*
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-*/}}
-
-{{- if and .Values.om.persistence.enabled (not 
.Values.om.persistence.existingClaim) }}
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
-  name: {{ .Release.Name }}-om
-  labels:
-    {{- include "ozone.labels" . | nindent 4 }}
-    app.kubernetes.io/component: om
-spec:
-  resources:
-    requests:
-      storage: {{ .Values.om.persistence.size }}
-  {{- with .Values.om.persistence.storageClassName }}
-  storageClassName: {{ . }}
-  {{- end }}
-{{- end }}
diff --git a/charts/ozone/templates/om/om-statefulset.yaml 
b/charts/ozone/templates/om/om-statefulset.yaml
index 6d5229e..b71c58c 100644
--- a/charts/ozone/templates/om/om-statefulset.yaml
+++ b/charts/ozone/templates/om/om-statefulset.yaml
@@ -79,7 +79,7 @@ spec:
           volumeMounts:
             - name: config
               mountPath: {{ .Values.configuration.dir }}
-            - name: data
+            - name: {{ .Release.Name }}-om
               mountPath: {{ .Values.om.persistence.path }}
       {{- with $nodeSelector }}
       nodeSelector: {{- toYaml . | nindent 8 }}
@@ -98,15 +98,29 @@ spec:
           projected:
             sources:
               - configMap:
-                  name: {{ .Release.Name }}
+                  name: {{ .Release.Name }}-ozone
               {{- with .Values.configuration.filesFrom }}
-                {{- tpl (toYaml .) $ | nindent 8 }}
+                {{- tpl (toYaml .) $ | nindent 14 }}
               {{- end }}
-        {{- if .Values.om.persistence.enabled }}
-        - name: data
-          persistentVolumeClaim:
-            claimName: {{ .Values.om.persistence.existingClaim | default 
(printf "%s-%s" .Release.Name "om") }}
-        {{- else }}
-        - name: data
+        {{- if not .Values.om.persistence.enabled }}
+        - name: {{ .Release.Name }}-om
           emptyDir: {}
         {{- end }}
+  {{- if .Values.om.persistence.enabled }}
+  volumeClaimTemplates:
+    - metadata:
+        name: {{ .Release.Name }}-om
+        labels:
+          {{- include "ozone.labels" . | nindent 10 }}
+          app.kubernetes.io/component: om
+      spec:
+        {{- with .Values.om.persistence.accessModes }}
+        accessModes: {{- toYaml . | nindent 10 }}
+        {{- end }}
+        resources:
+          requests:
+            storage: {{ .Values.om.persistence.size }}
+        {{- with .Values.scm.persistence.storageClassName }}
+        storageClassName: {{ . }}
+        {{- end }}
+  {{- end }}
\ No newline at end of file
diff --git a/charts/ozone/templates/ozone-configmap.yaml 
b/charts/ozone/templates/ozone-configmap.yaml
index 5a838fc..dbee026 100644
--- a/charts/ozone/templates/ozone-configmap.yaml
+++ b/charts/ozone/templates/ozone-configmap.yaml
@@ -19,7 +19,7 @@
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: {{ .Release.Name }}
+  name: {{ .Release.Name }}-ozone
   labels: {{- include "ozone.labels" . | nindent 4 }}
 data:
   {{- tpl (toYaml .Values.configuration.files) $ | nindent 4 }}
diff --git a/charts/ozone/templates/s3g/s3g-pvc.yaml 
b/charts/ozone/templates/s3g/s3g-pvc.yaml
deleted file mode 100644
index 9aaed84..0000000
--- a/charts/ozone/templates/s3g/s3g-pvc.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-{{/*
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-*/}}
-
-{{- if and .Values.s3g.persistence.enabled (not 
.Values.s3g.persistence.existingClaim) }}
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
-  name: {{ .Release.Name }}-s3g
-  labels:
-    {{- include "ozone.labels" . | nindent 4 }}
-    app.kubernetes.io/component: s3g
-spec:
-  resources:
-    requests:
-      storage: {{ .Values.s3g.persistence.size }}
-  {{- with .Values.s3g.persistence.storageClassName }}
-  storageClassName: {{ . }}
-  {{- end }}
-{{- end }}
diff --git a/charts/ozone/templates/s3g/s3g-statefulset.yaml 
b/charts/ozone/templates/s3g/s3g-statefulset.yaml
index 81dacb0..3f488d7 100644
--- a/charts/ozone/templates/s3g/s3g-statefulset.yaml
+++ b/charts/ozone/templates/s3g/s3g-statefulset.yaml
@@ -73,7 +73,7 @@ spec:
           volumeMounts:
             - name: config
               mountPath: {{ .Values.configuration.dir }}
-            - name: data
+            - name: {{ .Release.Name }}-s3g
               mountPath: {{ .Values.s3g.persistence.path }}
       {{- with $nodeSelector }}
       nodeSelector: {{- toYaml . | nindent 8 }}
@@ -92,15 +92,29 @@ spec:
           projected:
             sources:
               - configMap:
-                  name: {{ .Release.Name }}
+                  name: {{ .Release.Name }}-ozone
               {{- with .Values.configuration.filesFrom }}
-                {{- tpl (toYaml .) $ | nindent 8 }}
+                {{- tpl (toYaml .) $ | nindent 14 }}
               {{- end }}
-        {{- if .Values.s3g.persistence.enabled }}
-        - name: data
-          persistentVolumeClaim:
-            claimName: {{ .Values.s3g.persistence.existingClaim | default 
(printf "%s-%s" .Release.Name "s3g") }}
-        {{- else }}
-        - name: data
+        {{- if not .Values.s3g.persistence.enabled }}
+        - name: {{ .Release.Name }}-s3g
           emptyDir: {}
         {{- end }}
+  {{- if .Values.s3g.persistence.enabled }}
+  volumeClaimTemplates:
+    - metadata:
+        name: {{ .Release.Name }}-s3g
+        labels:
+          {{- include "ozone.labels" . | nindent 10 }}
+          app.kubernetes.io/component: s3g
+      spec:
+        {{- with .Values.s3g.persistence.accessModes }}
+        accessModes: {{- toYaml . | nindent 10 }}
+        {{- end }}
+        resources:
+          requests:
+            storage: {{ .Values.s3g.persistence.size }}
+        {{- with .Values.scm.persistence.storageClassName }}
+        storageClassName: {{ . }}
+        {{- end }}
+  {{- end }}
\ No newline at end of file
diff --git a/charts/ozone/templates/scm/scm-pvc.yaml 
b/charts/ozone/templates/scm/scm-pvc.yaml
deleted file mode 100644
index fd858f7..0000000
--- a/charts/ozone/templates/scm/scm-pvc.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-{{/*
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-*/}}
-
-{{- if and .Values.scm.persistence.enabled (not 
.Values.scm.persistence.existingClaim) }}
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
-  name: {{ .Release.Name }}-scm
-  labels:
-    {{- include "ozone.labels" . | nindent 4 }}
-    app.kubernetes.io/component: scm
-spec:
-  resources:
-    requests:
-      storage: {{ .Values.scm.persistence.size }}
-  {{- with .Values.scm.persistence.storageClassName }}
-  storageClassName: {{ . }}
-  {{- end }}
-{{- end }}
diff --git a/charts/ozone/templates/scm/scm-statefulset.yaml 
b/charts/ozone/templates/scm/scm-statefulset.yaml
index 6a97983..457ba26 100644
--- a/charts/ozone/templates/scm/scm-statefulset.yaml
+++ b/charts/ozone/templates/scm/scm-statefulset.yaml
@@ -59,7 +59,7 @@ spec:
           volumeMounts:
             - name: config
               mountPath: {{ .Values.configuration.dir }}
-            - name: data
+            - name: {{ .Release.Name }}-scm
               mountPath: {{ .Values.scm.persistence.path }}
       containers:
         - name: scm
@@ -94,7 +94,7 @@ spec:
           volumeMounts:
             - name: config
               mountPath: {{ .Values.configuration.dir }}
-            - name: data
+            - name: {{ .Release.Name }}-scm
               mountPath: {{ .Values.scm.persistence.path }}
       {{- with $nodeSelector }}
       nodeSelector: {{- toYaml . | nindent 8 }}
@@ -113,15 +113,29 @@ spec:
           projected:
             sources:
               - configMap:
-                  name: {{ .Release.Name }}
+                  name: {{ .Release.Name }}-ozone
               {{- with .Values.configuration.filesFrom }}
-                {{- tpl (toYaml .) $ | nindent 8 }}
+                {{- tpl (toYaml .) $ | nindent 14 }}
               {{- end }}
-        {{- if .Values.scm.persistence.enabled }}
-        - name: data
-          persistentVolumeClaim:
-            claimName: {{ .Values.scm.persistence.existingClaim | default 
(printf "%s-%s" .Release.Name "scm") }}
-        {{- else }}
-        - name: data
+        {{- if not .Values.scm.persistence.enabled }}
+        - name: {{ .Release.Name }}-scm
           emptyDir: {}
         {{- end }}
+  {{- if .Values.scm.persistence.enabled }}
+  volumeClaimTemplates:
+    - metadata:
+        name: {{ .Release.Name }}-scm
+        labels:
+          {{- include "ozone.labels" . | nindent 10 }}
+          app.kubernetes.io/component: scm
+      spec:
+        {{- with .Values.scm.persistence.accessModes }}
+        accessModes: {{- toYaml . | nindent 10 }}
+        {{- end }}
+        resources:
+          requests:
+            storage: {{ .Values.scm.persistence.size }}
+        {{- with .Values.scm.persistence.storageClassName }}
+        storageClassName: {{ . }}
+        {{- end }}
+  {{- end }}
\ No newline at end of file
diff --git a/charts/ozone/values.yaml b/charts/ozone/values.yaml
index 35aaebe..9c2dc4a 100644
--- a/charts/ozone/values.yaml
+++ b/charts/ozone/values.yaml
@@ -88,10 +88,11 @@ datanode:
   persistence:
     # Enable persistence
     enabled: false
+    # Persistence access modes
+    accessModes:
+      - ReadWriteOnce
     # Path for datanode volume mount
     path: /data
-    # Existing PVC name to use
-    existingClaim: ~
     # Volume size
     size: 10Gi
     # The name of a specific storage class name to use
@@ -126,10 +127,11 @@ om:
   persistence:
     # Enable persistence
     enabled: false
+    # Persistence access modes
+    accessModes:
+      - ReadWriteOnce
     # Path for Ozone Manager volume mount
     path: /data
-    # Existing PVC name to use
-    existingClaim: ~
     # Volume size
     size: 10Gi
     # The name of a specific storage class name to use
@@ -164,10 +166,11 @@ s3g:
   persistence:
     # Enable persistence
     enabled: false
+    # Persistence access modes
+    accessModes:
+      - ReadWriteOnce
     # Path for S3 Gateway volume mount
     path: /data
-    # Existing PVC name to use
-    existingClaim: ~
     # Volume size
     size: 10Gi
     # The name of a specific storage class name to use
@@ -202,10 +205,11 @@ scm:
   persistence:
     # Enable persistence
     enabled: false
+    # Persistence access modes
+    accessModes:
+      - ReadWriteOnce
     # Path for Storage Container Manager volume mount
     path: /data
-    # Existing PVC name to use
-    existingClaim: ~
     # Volume size
     size: 10Gi
     # The name of a specific storage class name to use


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to