apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: {{ include "nemo-kubernetes-operator.fullname" . }}-proxy-role
  labels:
    app.kubernetes.io/component: kube-rbac-proxy
    app.kubernetes.io/created-by: nemo-kubernetes-operator
    app.kubernetes.io/part-of: nemo-kubernetes-operator
  {{- include "nemo-kubernetes-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
  - authentication.k8s.io
  resources:
  - tokenreviews
  verbs:
  - create
- apiGroups:
  - authorization.k8s.io
  resources:
  - subjectaccessreviews
  verbs:
  - create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ include "nemo-kubernetes-operator.fullname" . }}-proxy-rolebinding
  labels:
    app.kubernetes.io/component: kube-rbac-proxy
    app.kubernetes.io/created-by: nemo-kubernetes-operator
    app.kubernetes.io/part-of: nemo-kubernetes-operator
  {{- include "nemo-kubernetes-operator.labels" . | nindent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: '{{ include "nemo-kubernetes-operator.fullname" . }}-proxy-role'
subjects:
- kind: ServiceAccount
  name: '{{ include "nemo-kubernetes-operator.fullname" . }}-controller-manager'
  namespace: '{{ .Release.Namespace }}'