From 7ab8c6976effc5ddd876b6b4fde58ecf0015e9c5 Mon Sep 17 00:00:00 2001 From: Armand LEOPOLD Date: Wed, 19 Jul 2023 06:44:19 +0200 Subject: [PATCH] Add variabilisation of RBAC (#4692) * Add variabilisation of RBAC * fix also filer reference --- k8s/charts/seaweedfs/templates/filer-statefulset.yaml | 2 ++ k8s/charts/seaweedfs/templates/service-account.yaml | 2 ++ k8s/charts/seaweedfs/values.yaml | 1 + 3 files changed, 5 insertions(+) diff --git a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml index 054ad1ccd..b770025a1 100644 --- a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml @@ -46,7 +46,9 @@ spec: imagePullSecrets: - name: {{ .Values.global.imagePullSecrets }} {{- end }} + {{- if .Values.global.createClusterRole }} serviceAccountName: seaweedfs-rw-sa #hack for delete pod master after migration + {{- end }} terminationGracePeriodSeconds: 60 {{- if .Values.filer.priorityClassName }} priorityClassName: {{ .Values.filer.priorityClassName | quote }} diff --git a/k8s/charts/seaweedfs/templates/service-account.yaml b/k8s/charts/seaweedfs/templates/service-account.yaml index 22c29b56a..89f531174 100644 --- a/k8s/charts/seaweedfs/templates/service-account.yaml +++ b/k8s/charts/seaweedfs/templates/service-account.yaml @@ -1,3 +1,4 @@ +{{- if .Values.global.createClusterRole }} #hack for delete pod master after migration --- kind: ClusterRole @@ -27,3 +28,4 @@ roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: seaweedfs-rw-cr +{{- end }} diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml index 3ed0f5d55..8a4148102 100644 --- a/k8s/charts/seaweedfs/values.yaml +++ b/k8s/charts/seaweedfs/values.yaml @@ -1,6 +1,7 @@ # Available parameters and their default values for the SeaweedFS chart. global: + createClusterRole: true registry: "" repository: "" imageName: chrislusf/seaweedfs