apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: {{ .Values.roleName }}
  namespace: {{ .Release.Namespace }}
  labels:
    mizu-cli-version: {{ .Chart.AppVersion }}
rules:
  - apiGroups: [ "apps" ]
    resources: [ "daemonsets" ]
    verbs: [ "patch", "get", "list", "create", "delete" ]
  - apiGroups: [ "events.k8s.i" ]
    resources: [ "events" ]
    verbs: [ "list", "watch" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ .Values.roleBindingName }}
  namespace: {{ .Release.Namespace }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ .Values.roleName }}
subjects:
  - kind: ServiceAccount
    name: {{ .Values.serviceAccountName }}
    namespace: {{ .Release.Namespace }}
---
