From 9786b95ec4808682c25c17a996092deb3d747ade Mon Sep 17 00:00:00 2001 From: TobiasPyttel Date: Wed, 23 Oct 2024 02:53:32 +0200 Subject: [PATCH 1/8] HDDS-11597 fixed persistent feature in helm chart statefulSet --- charts/ozone/Chart.yaml | 2 +- .../templates/datanode/datanode-pvc.yaml | 34 ------------------- .../datanode/datanode-statefulset.yaml | 34 +++++++++++++------ 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 ------------------- .../ozone/templates/s3g/s3g-statefulset.yaml | 32 ++++++++++++----- charts/ozone/templates/scm/scm-pvc.yaml | 34 ------------------- .../ozone/templates/scm/scm-statefulset.yaml | 34 +++++++++++++------ charts/ozone/values.yaml | 20 ++++++----- 11 files changed, 108 insertions(+), 184 deletions(-) delete mode 100644 charts/ozone/templates/datanode/datanode-pvc.yaml delete mode 100644 charts/ozone/templates/om/om-pvc.yaml delete mode 100644 charts/ozone/templates/s3g/s3g-pvc.yaml delete mode 100644 charts/ozone/templates/scm/scm-pvc.yaml 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..a4b8b4e 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 - emptyDir: {} + {{- 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 From 14f96337fc186588f54013717e45c98476d4b670 Mon Sep 17 00:00:00 2001 From: TobiasPyttel Date: Wed, 23 Oct 2024 10:34:51 +0200 Subject: [PATCH 2/8] HDDS-11597 enabled Test Charts workflow --- .github/workflows/test.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e30d960..4a9758e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,7 +1,12 @@ name: Test Charts -on: pull_request - +on: + pull_request: + branches: + - "*" + push: + branches: + - "*" jobs: test: runs-on: ubuntu-latest From 23d435b5a761bf92b1df8fe8b7e6649c27b77e6a Mon Sep 17 00:00:00 2001 From: TobiasPyttel Date: Wed, 23 Oct 2024 10:38:39 +0200 Subject: [PATCH 3/8] HDDS-11597 enabled Test Charts workflow --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4a9758e..26bf759 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,10 +3,10 @@ name: Test Charts on: pull_request: branches: - - "*" + - '*' push: branches: - - "*" + - '*' jobs: test: runs-on: ubuntu-latest From 30c75e7d945e34810eaae7cd6d63e991f746e2bc Mon Sep 17 00:00:00 2001 From: TobiasPyttel Date: Wed, 23 Oct 2024 10:41:49 +0200 Subject: [PATCH 4/8] HDDS-11597 enabled Test Charts workflow --- .github/workflows/test.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 26bf759..dd16122 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,12 +1,6 @@ name: Test Charts -on: - pull_request: - branches: - - '*' - push: - branches: - - '*' +on: push jobs: test: runs-on: ubuntu-latest From c6b1e9d162824eab955bcebc6c43d34c8f233551 Mon Sep 17 00:00:00 2001 From: TobiasPyttel Date: Wed, 23 Oct 2024 10:48:21 +0200 Subject: [PATCH 5/8] Revert "HDDS-11597 enabled Test Charts workflow" This reverts commit 30c75e7d945e34810eaae7cd6d63e991f746e2bc. --- .github/workflows/test.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dd16122..26bf759 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,12 @@ name: Test Charts -on: push +on: + pull_request: + branches: + - '*' + push: + branches: + - '*' jobs: test: runs-on: ubuntu-latest From d7ab9856aa717a61220a12c2e24275ad7edc7ff3 Mon Sep 17 00:00:00 2001 From: TobiasPyttel Date: Wed, 23 Oct 2024 10:48:26 +0200 Subject: [PATCH 6/8] Revert "HDDS-11597 enabled Test Charts workflow" This reverts commit 23d435b5a761bf92b1df8fe8b7e6649c27b77e6a. --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 26bf759..4a9758e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,10 +3,10 @@ name: Test Charts on: pull_request: branches: - - '*' + - "*" push: branches: - - '*' + - "*" jobs: test: runs-on: ubuntu-latest From 49b6e7437934795d4aea69258ddd17af35d48fbd Mon Sep 17 00:00:00 2001 From: TobiasPyttel Date: Wed, 23 Oct 2024 10:49:17 +0200 Subject: [PATCH 7/8] Revert "HDDS-11597 enabled Test Charts workflow" This reverts commit 14f96337fc186588f54013717e45c98476d4b670. --- .github/workflows/test.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4a9758e..e30d960 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,12 +1,7 @@ name: Test Charts -on: - pull_request: - branches: - - "*" - push: - branches: - - "*" +on: pull_request + jobs: test: runs-on: ubuntu-latest From e7ed32def8b25b48e0159ba3135792c651d80f94 Mon Sep 17 00:00:00 2001 From: pyttel <80945247+pyttel@users.noreply.github.com> Date: Sun, 27 Oct 2024 14:08:25 +0100 Subject: [PATCH 8/8] Update charts/ozone/templates/datanode/datanode-statefulset.yaml Co-authored-by: Denis Krivenko --- charts/ozone/templates/datanode/datanode-statefulset.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/ozone/templates/datanode/datanode-statefulset.yaml b/charts/ozone/templates/datanode/datanode-statefulset.yaml index a4b8b4e..a9320d1 100644 --- a/charts/ozone/templates/datanode/datanode-statefulset.yaml +++ b/charts/ozone/templates/datanode/datanode-statefulset.yaml @@ -98,7 +98,7 @@ spec: {{- end }} {{- if not .Values.datanode.persistence.enabled }} - name: {{ .Release.Name }}-datanode - emptyDir: { } + emptyDir: {} {{- end }} {{- if .Values.datanode.persistence.enabled }} volumeClaimTemplates: