From 43a6b603752c9463b8e4933c347980541d3eceaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20J=C3=B3zsef=20J=C3=A1nv=C3=A1ri?= <4534880+dzsibi@users.noreply.github.com> Date: Wed, 6 Dec 2023 07:19:31 +0100 Subject: [PATCH] Always include volumes in statefulsets --- k8s/charts/seaweedfs/templates/_helpers.tpl | 44 ------------------- .../templates/master-statefulset.yaml | 4 -- .../templates/volume-statefulset.yaml | 3 -- 3 files changed, 51 deletions(-) diff --git a/k8s/charts/seaweedfs/templates/_helpers.tpl b/k8s/charts/seaweedfs/templates/_helpers.tpl index 8babbf93b..dd118c86b 100644 --- a/k8s/charts/seaweedfs/templates/_helpers.tpl +++ b/k8s/charts/seaweedfs/templates/_helpers.tpl @@ -122,19 +122,6 @@ Inject extra environment vars in the format key:value, if populated {{- end -}} {{- end -}} -{{/* check if any Volume HostPath exists */}} -{{- define "volume.hostpath_exists" -}} -{{- if or (or (eq .Values.volume.data.type "hostPath") (and (eq .Values.volume.idx.type "hostPath") .Values.volume.dir_idx )) (eq .Values.volume.logs.type "hostPath") -}} -{{- printf "true" -}} -{{- else -}} -{{- if or .Values.global.enableSecurity .Values.volume.extraVolumes -}} -{{- printf "true" -}} -{{- else -}} -{{- printf "" -}} -{{- end -}} -{{- end -}} -{{- end -}} - {{/* check if any Filer PVC exists */}} {{- define "filer.pvc_exists" -}} {{- if or (eq .Values.filer.data.type "persistentVolumeClaim") (eq .Values.filer.logs.type "persistentVolumeClaim") -}} @@ -144,15 +131,6 @@ Inject extra environment vars in the format key:value, if populated {{- end -}} {{- end -}} -{{/* check if any Filer HostPath exists */}} -{{- define "filer.hostpath_exists" -}} -{{- if or (eq .Values.filer.data.type "hostPath") (eq .Values.filer.logs.type "hostPath") -}} -{{- printf "true" -}} -{{- else -}} -{{- printf "" -}} -{{- end -}} -{{- end -}} - {{/* check if any Master PVC exists */}} {{- define "master.pvc_exists" -}} {{- if or (eq .Values.master.data.type "persistentVolumeClaim") (eq .Values.master.logs.type "persistentVolumeClaim") -}} @@ -162,28 +140,6 @@ Inject extra environment vars in the format key:value, if populated {{- end -}} {{- end -}} -{{/* check if any Master HostPath exists */}} -{{- define "master.hostpath_exists" -}} -{{- if or (eq .Values.master.data.type "hostPath") (eq .Values.master.logs.type "hostPath") -}} -{{- printf "true" -}} -{{- else -}} -{{- if or .Values.global.enableSecurity .Values.volume.extraVolumes -}} -{{- printf "true" -}} -{{- else -}} -{{- printf "" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* check if any Master existingClaim is defined */}} -{{- define "master.existing_claims" -}} -{{- if or (eq .Values.master.data.type "existingClaim") (eq .Values.master.logs.type "existingClaim") -}} -{{- printf "true" -}} -{{- else -}} -{{- printf "" -}} -{{- end -}} -{{- end -}} - {{/* check if any InitContainers exist for Volumes */}} {{- define "volume.initContainers_exists" -}} {{- if or (not (empty .Values.volume.dir_idx )) (not (empty .Values.volume.initContainers )) -}} diff --git a/k8s/charts/seaweedfs/templates/master-statefulset.yaml b/k8s/charts/seaweedfs/templates/master-statefulset.yaml index db36d4ab6..19c30f07d 100644 --- a/k8s/charts/seaweedfs/templates/master-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/master-statefulset.yaml @@ -212,9 +212,6 @@ spec: resources: {{ tpl .Values.master.resources . | nindent 12 | trim }} {{- end }} - {{- $hostpath_exists := include "master.hostpath_exists" . -}} - {{- $existing_claims := include "master.existing_claims" . -}} - {{- if or ($hostpath_exists) ($existing_claims) }} volumes: {{- if eq .Values.master.logs.type "hostPath" }} - name: seaweedfs-master-log-volume @@ -262,7 +259,6 @@ spec: secretName: {{ template "seaweedfs.name" . }}-client-cert {{- end }} {{ tpl .Values.master.extraVolumes . | indent 8 | trim }} - {{- end }} {{- if .Values.master.nodeSelector }} nodeSelector: {{ tpl .Values.master.nodeSelector . | indent 8 | trim }} diff --git a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml b/k8s/charts/seaweedfs/templates/volume-statefulset.yaml index e74311673..1b8c9267e 100644 --- a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/volume-statefulset.yaml @@ -218,8 +218,6 @@ spec: resources: {{ tpl .Values.volume.resources . | nindent 12 | trim }} {{- end }} - {{- $hostpath_exists := include "volume.hostpath_exists" . -}} - {{- if $hostpath_exists }} volumes: {{- if eq .Values.volume.data.type "hostPath" }} - name: data @@ -277,7 +275,6 @@ spec: {{- if .Values.volume.extraVolumes }} {{ tpl .Values.volume.extraVolumes . | indent 8 | trim }} {{- end }} - {{- end }} {{- if .Values.volume.nodeSelector }} nodeSelector: {{ tpl .Values.volume.nodeSelector . | indent 8 | trim }}