apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: k8s-nim-operator-leader-election-role
  labels:
    app.kubernetes.io/component: rbac
    app.kubernetes.io/created-by: k8s-nim-operator
    app.kubernetes.io/part-of: k8s-nim-operator
  {{- include "k8s-nim-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: k8s-nim-operator-leader-election-rolebinding
  labels:
    app.kubernetes.io/component: rbac
    app.kubernetes.io/created-by: k8s-nim-operator
    app.kubernetes.io/part-of: k8s-nim-operator
  {{- include "k8s-nim-operator.labels" . | nindent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: k8s-nim-operator-leader-election-role
subjects:
- kind: ServiceAccount
  name: k8s-nim-operator
  namespace: '{{ .Release.Namespace }}'
