kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: {{ include "trust-manager.name" . }}
  namespace: {{ .Values.app.trust.namespace }}
  labels:
    {{- include "trust-manager.labels" . | nindent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ include "trust-manager.name" . }}
subjects:
- kind: ServiceAccount
  name: {{ include "trust-manager.name" . }}
  namespace: {{ include "trust-manager.namespace" . }}
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: {{ include "trust-manager.name" . }}:leaderelection
  namespace: {{ include "trust-manager.namespace" . }}
  labels:
    {{- include "trust-manager.labels" . | nindent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ include "trust-manager.name" . }}:leaderelection
subjects:
- kind: ServiceAccount
  name: {{ include "trust-manager.name" . }}
  namespace: {{ include "trust-manager.namespace" . }}
