blob: 9bf57d23e6d6770047a0ced4edaccd67bd42189d [file] [log] [blame]
Giorgi Lekveishviliec6b3cc2023-12-01 16:30:04 +04001{{- if and .Values.autoscaler.enabled .Values.rbac.create }}
2---
3apiVersion: rbac.authorization.k8s.io/v1
4kind: ClusterRole
5metadata:
6 name: {{ template "coredns.fullname" . }}-autoscaler
7 labels: {{- include "coredns.labels.autoscaler" . | nindent 4 }}
8{{- if .Values.customLabels }}
9{{ toYaml .Values.customLabels | indent 4 }}
10{{- end }}
11{{- with .Values.customAnnotations }}
12 annotations:
13{{- toYaml . | nindent 4 }}
14{{- end }}
15rules:
16 - apiGroups: [""]
17 resources: ["nodes"]
18 verbs: ["list","watch"]
19 - apiGroups: [""]
20 resources: ["replicationcontrollers/scale"]
21 verbs: ["get", "update"]
22 - apiGroups: ["extensions", "apps"]
23 resources: ["deployments/scale", "replicasets/scale"]
24 verbs: ["get", "update"]
25# Remove the configmaps rule once below issue is fixed:
26# kubernetes-incubator/cluster-proportional-autoscaler#16
27 - apiGroups: [""]
28 resources: ["configmaps"]
29 verbs: ["get", "create"]
30{{- end }}