-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrole.yaml
30 lines (28 loc) · 899 Bytes
/
role.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{{- if .Values.constrainedDownscaler }}
{{- if not .Values.constrainedNamespaces }}
{{- fail "Error: 'constrainedNamespaces' must not be empty or null when 'constrainedDownscaler' is true." }}
{{- end }}
{{- range $namespace := .Values.constrainedNamespaces }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "go-kube-downscaler.fullname" . }}
namespace: {{ $namespace }}
rules:
{{ include "go-kube-downscaler.permissions" . }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "go-kube-downscaler.fullname" . }}
namespace: {{ $namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "go-kube-downscaler.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "go-kube-downscaler.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}