diff --git a/k8s/charts/seaweedfs/templates/cosi/cosi-cluster-role.yaml b/k8s/charts/seaweedfs/templates/cosi/cosi-cluster-role.yaml index b5c103575..bf4127992 100644 --- a/k8s/charts/seaweedfs/templates/cosi/cosi-cluster-role.yaml +++ b/k8s/charts/seaweedfs/templates/cosi/cosi-cluster-role.yaml @@ -28,6 +28,13 @@ rules: - "update" - "create" - "delete" +- apiGroups: ["objectstorage.k8s.io"] + resources: + - "bucketclasses" + verbs: + - "get" + - "list" + - "watch" - apiGroups: ["coordination.k8s.io"] resources: ["leases"] verbs: @@ -61,7 +68,7 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} subjects: - kind: ServiceAccount - name: {{ .Values.global.seaweedfs.serviceAccountName }}-objectstorage-provisioner + name: {{ include "seaweedfs.serviceAccountName" . }}-objectstorage-provisioner namespace: {{ .Release.Namespace }} roleRef: kind: ClusterRole diff --git a/k8s/charts/seaweedfs/templates/cosi/cosi-deployment.yaml b/k8s/charts/seaweedfs/templates/cosi/cosi-deployment.yaml index 09d79da0a..a3cb650ce 100644 --- a/k8s/charts/seaweedfs/templates/cosi/cosi-deployment.yaml +++ b/k8s/charts/seaweedfs/templates/cosi/cosi-deployment.yaml @@ -61,7 +61,7 @@ spec: schedulerName: {{ .Values.cosi.schedulerName | quote }} {{- end }} enableServiceLinks: false - serviceAccountName: {{ include "seaweedfs.componentName" (list . "objectstorage-provisioner") }} + serviceAccountName: {{ include "seaweedfs.serviceAccountName" . }}-objectstorage-provisioner {{- if .Values.cosi.initContainers }} initContainers: {{ tpl .Values.cosi.initContainers . | nindent 8 | trim }} diff --git a/k8s/charts/seaweedfs/templates/cosi/cosi-service-account.yaml b/k8s/charts/seaweedfs/templates/cosi/cosi-service-account.yaml index 6d0a4bc38..5df150469 100644 --- a/k8s/charts/seaweedfs/templates/cosi/cosi-service-account.yaml +++ b/k8s/charts/seaweedfs/templates/cosi/cosi-service-account.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ .Values.global.seaweedfs.serviceAccountName }}-objectstorage-provisioner + name: {{ include "seaweedfs.serviceAccountName" . }}-objectstorage-provisioner namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/name: {{ template "seaweedfs.name" . }}