apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ template "rancher.fullname" . }}-pre-upgrade
  labels: {{ include "rancher.labels" . | nindent 4 }}
  annotations:
    "helm.sh/hook": pre-upgrade
    "helm.sh/hook-weight": "-1"
    "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "rancher.fullname" . }}-pre-upgrade
subjects:
  - kind: ServiceAccount
    name: {{ template "rancher.fullname" . }}-pre-upgrade
    namespace: {{ .Release.Namespace }}
