{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  labels:
{{ include "cluster-autoscaler.labels" . | indent 4 }}
  name: {{ template "cluster-autoscaler.fullname" . }}
rules:
  - apiGroups:
      - ""
    resources:
      - configmaps
    verbs:
      - create
  - apiGroups:
      - ""
    resources:
      - configmaps
    resourceNames:
      - cluster-autoscaler-status
    verbs:
      - delete
      - get
      - update
{{- end -}}
