diff --git a/chart/stash/templates/cluster-role-binding.yaml b/chart/stash/templates/cluster-role-binding.yaml new file mode 100644 index 000000000..4ba21801e --- /dev/null +++ b/chart/stash/templates/cluster-role-binding.yaml @@ -0,0 +1,20 @@ +{{ if .Values.rbac.install }} +{{- $serviceName := include "fullname" . -}} +apiVersion: rbac.authorization.k8s.io/{{ required "A valid .Values.rbac.apiVersion entry required!" .Values.rbac.apiVersion }} +kind: ClusterRoleBinding +metadata: + name: {{ $serviceName }} + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app: "{{ template "name" . }}" + heritage: "{{ .Release.Service }}" + release: "{{ .Release.Name }}" +subjects: +- kind: ServiceAccount + name: {{ $serviceName }} + namespace: {{ .Release.Namespace }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ $serviceName }} +{{ end }} diff --git a/chart/stash/templates/rbac.yaml b/chart/stash/templates/cluster-role.yaml similarity index 66% rename from chart/stash/templates/rbac.yaml rename to chart/stash/templates/cluster-role.yaml index f086eda6b..3523bbca8 100644 --- a/chart/stash/templates/rbac.yaml +++ b/chart/stash/templates/cluster-role.yaml @@ -49,22 +49,4 @@ rules: resources: - pods verbs: ["list", delete"] ---- -apiVersion: rbac.authorization.k8s.io/{{ required "A valid .Values.rbac.apiVersion entry required!" .Values.rbac.apiVersion }} -kind: ClusterRoleBinding -metadata: - name: {{ $serviceName }} - labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - app: "{{ template "name" . }}" - heritage: "{{ .Release.Service }}" - release: "{{ .Release.Name }}" -subjects: -- kind: ServiceAccount - name: {{ $serviceName }} - namespace: {{ .Release.Namespace }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ $serviceName }} {{ end }} diff --git a/chart/stash/templates/deployment.yaml b/chart/stash/templates/deployment.yaml index 4dc8f8197..95c63a710 100644 --- a/chart/stash/templates/deployment.yaml +++ b/chart/stash/templates/deployment.yaml @@ -8,13 +8,11 @@ metadata: heritage: "{{ .Release.Service }}" release: "{{ .Release.Name }}" spec: - replicas: {{.Values.replicaCount}} + replicas: {{ .Values.replicaCount }} template: metadata: labels: - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" app: "{{ template "name" . }}" - heritage: "{{ .Release.Service }}" release: "{{ .Release.Name }}" spec: {{- if .Values.rbac.install }}