# helm_charts_server-write-clusterrole.yaml
{{- if .Values.server.enabled -}}
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  labels:
    app: {{ template "kiam.name" . }}
    chart: {{ template "kiam.chart" . }}
    component: "{{ .Values.server.name }}"
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: {{ template "kiam.fullname" . }}-write
rules:
  - apiGroups:
      - ""
    resources:
      - events
    verbs:
      - create
      - patch
{{- end -}}
{{- end -}}