{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
  namespace: {{ .Values.namespace }}
  labels:
    app: {{ template "gcloud-sqlproxy.fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  name: {{ template "gcloud-sqlproxy.fullname" . }}
rules:
- apiGroups: [""]
  resources: ["secrets"]
  verbs: ["get", "watch", "list"]
{{- end }}
