From c332832f0b2473610fa52b76280d6dea4c14add7 Mon Sep 17 00:00:00 2001 From: jessebot Date: Sun, 26 Nov 2023 14:00:15 +0100 Subject: [PATCH] prefer global.serviceAccountName when available for all statefulsets --- k8s/charts/seaweedfs/templates/filer-statefulset.yaml | 2 +- k8s/charts/seaweedfs/templates/master-statefulset.yaml | 2 +- k8s/charts/seaweedfs/templates/volume-statefulset.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml index 1b316ca60..9aeab5315 100644 --- a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml @@ -52,7 +52,7 @@ spec: {{- end }} {{- include "seaweedfs.imagePullSecrets" . | nindent 6 }} {{- if .Values.global.createClusterRole }} - serviceAccountName: seaweedfs-rw-sa #hack for delete pod master after migration + serviceAccountName: {{ default .Values.global.serviceAccountName .Values.filer.serviceAccountName }} # for deleting statefulset pods after migration {{- end }} terminationGracePeriodSeconds: 60 {{- if .Values.filer.priorityClassName }} diff --git a/k8s/charts/seaweedfs/templates/master-statefulset.yaml b/k8s/charts/seaweedfs/templates/master-statefulset.yaml index a8c4cdaf0..081e9ec2a 100644 --- a/k8s/charts/seaweedfs/templates/master-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/master-statefulset.yaml @@ -56,7 +56,7 @@ spec: {{- end }} enableServiceLinks: false {{- if .Values.master.serviceAccountName }} - serviceAccountName: {{ .Values.master.serviceAccountName | quote }} + serviceAccountName: {{ default .Values.global.serviceAccountName .Values.master.serviceAccountName }} # for deleting statefulset pods after migration {{- end }} {{- if .Values.master.initContainers }} initContainers: diff --git a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml b/k8s/charts/seaweedfs/templates/volume-statefulset.yaml index dc89cf9d3..d12319546 100644 --- a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/volume-statefulset.yaml @@ -50,7 +50,7 @@ spec: {{- end }} enableServiceLinks: false {{- if .Values.volume.serviceAccountName }} - serviceAccountName: {{ .Values.volume.serviceAccountName | quote }} + serviceAccountName: {{ default .Values.global.serviceAccountName .Values.volume.serviceAccountName }} # for deleting statefulset pods after migration {{- end }} {{- $initContainers_exists := include "volume.initContainers_exists" . -}} {{- if $initContainers_exists }}