aboutsummaryrefslogtreecommitdiff
path: root/script/helm/garage/templates/clusterrole.yaml
blob: fa3e6405bf78eabcdc9c87dce6b3144c8b6cce31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: manage-crds-{{ .Release.Namespace }}-{{ .Release.Name }}
  labels:
    {{- include "garage.labels" . | nindent 4 }}
rules:
- apiGroups: ["apiextensions.k8s.io"]
  resources: ["customresourcedefinitions"]
  verbs: ["get", "list", "watch", "create", "patch"]
- apiGroups: ["deuxfleurs.fr"]
  resources: ["garagenodes"]
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: allow-crds-for-{{ .Release.Namespace }}-{{ .Release.Name }}
  labels:
    {{- include "garage.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
  name: {{ include "garage.serviceAccountName" . }}
  namespace: {{ .Release.Namespace }}
roleRef:
  kind: ClusterRole
  name: manage-crds-{{ .Release.Namespace }}-{{ .Release.Name }}
  apiGroup: rbac.authorization.k8s.io