From 332d19b29892631e52af0c62b9992835ad2ca0dc Mon Sep 17 00:00:00 2001 From: Blagoj Atanasovski <46002495+atanasovskib@users.noreply.github.com> Date: Fri, 2 Aug 2024 20:18:15 +0200 Subject: [PATCH] Remove duplicate RBAC setup (#28) --- .../templates/daemonset.yaml | 1 + .../templates/service-acc.yaml | 27 ------------------- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 charts/gpu-metrics-exporter/templates/service-acc.yaml diff --git a/charts/gpu-metrics-exporter/templates/daemonset.yaml b/charts/gpu-metrics-exporter/templates/daemonset.yaml index 571bd6c..9a609ae 100644 --- a/charts/gpu-metrics-exporter/templates/daemonset.yaml +++ b/charts/gpu-metrics-exporter/templates/daemonset.yaml @@ -53,6 +53,7 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} + serviceAccountName: {{ include "gpu-metrics-exporter.serviceAccountName" . }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/gpu-metrics-exporter/templates/service-acc.yaml b/charts/gpu-metrics-exporter/templates/service-acc.yaml deleted file mode 100644 index a523b69..0000000 --- a/charts/gpu-metrics-exporter/templates/service-acc.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: gpu-exporter-sa - namespace: {{ .Release.Namespace }} ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: list-pods-clusterrole -rules: - - apiGroups: [""] - resources: ["pods"] - verbs: ["list"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: list-pods-clusterrolebinding -subjects: - - kind: ServiceAccount - name: gpu-exporter-sa - namespace: {{ .Release.Namespace }} -roleRef: - kind: ClusterRole - name: list-pods-clusterrole - apiGroup: rbac.authorization.k8s.io