onedev-server/server-product/helm/templates/clusterrole.yaml

23 lines
1.0 KiB
YAML

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "ods.fullname" . }}
labels:
{{- include "ods.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list", "create", "delete"] #require this permission to run builds in isolated namespaces
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["clusterrolebindings"]
verbs: ["get", "list", "create", "delete"] #require this permission to bind cluster roles to service account of running builds
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list"] #require this permission to search nodes matching executor criterias
- apiGroups: [""]
resources: ["services", "pods", "pods/log", "pods/exec", "secrets", "configmaps", "events"]
verbs: ["get", "list", "watch", "create", "patch", "delete"] #require this permission to run builds as pods
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "list", "create", "patch", "delete"] #require this permission to run builds as pods