rancher-partner-charts/charts/koor-tech/koor-operator/templates/job-rbac.yaml

78 lines
1.5 KiB
YAML

apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "koor-operator.jobName" . }}
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: koor-operator
app.kubernetes.io/part-of: koor-operator
{{- include "koor-operator.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "koor-operator.fullname" . }}-job-role
labels:
{{- include "koor-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- namespaces
verbs:
- create
- get
- list
- patch
- update
- watch
- apiGroups:
- storage.koor.tech
resources:
- koorclusters
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- delete
- apiGroups:
- apps
resources:
- deployments
verbs:
- delete
- apiGroups:
- cert-manager.io
resources:
- certificates
- issuers
verbs:
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "koor-operator.fullname" . }}-job-rolebinding
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: koor-operator
app.kubernetes.io/part-of: koor-operator
{{- include "koor-operator.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: '{{ include "koor-operator.fullname" . }}-job-role'
subjects:
- kind: ServiceAccount
name: '{{ include "koor-operator.jobName" . }}'
namespace: '{{ .Release.Namespace }}'