| Giorgi Lekveishvili | ec6b3cc | 2023-12-01 16:30:04 +0400 | [diff] [blame] | 1 | {{- if and .Values.autoscaler.enabled .Values.rbac.create }} |
| 2 | --- |
| 3 | apiVersion: rbac.authorization.k8s.io/v1 |
| 4 | kind: ClusterRoleBinding |
| 5 | metadata: |
| 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 }} |
| 15 | roleRef: |
| 16 | apiGroup: rbac.authorization.k8s.io |
| 17 | kind: ClusterRole |
| 18 | name: {{ template "coredns.fullname" . }}-autoscaler |
| 19 | subjects: |
| 20 | - kind: ServiceAccount |
| 21 | name: {{ template "coredns.fullname" . }}-autoscaler |
| 22 | namespace: {{ .Release.Namespace }} |
| 23 | {{- end }} |