blob: c1f901d50cd835772dd208ff50c2cbf74c984b95 [file] [log] [blame]
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +04001{{- if .Values.rbac.create }}
2
3{{- if and .Values.rbac.scope (not .Values.controller.scope.enabled) -}}
4 {{ required "Invalid configuration: 'rbac.scope' should be equal to 'controller.scope.enabled' (true/false)." (index (dict) ".") }}
5{{- end }}
6
7{{- if not .Values.rbac.scope -}}
8apiVersion: rbac.authorization.k8s.io/v1
9kind: ClusterRole
10metadata:
11 labels:
12 {{- include "ingress-nginx.labels" . | nindent 4 }}
13 name: {{ include "ingress-nginx.fullname" . }}
14rules:
15 - apiGroups:
16 - ""
17 resources:
18 - configmaps
19 - endpoints
20 - nodes
21 - pods
22 - secrets
23 verbs:
24 - list
25 - watch
26{{- if and .Values.controller.scope.enabled .Values.controller.scope.namespace }}
27 - apiGroups:
28 - ""
29 resources:
30 - namespaces
31 resourceNames:
32 - "{{ .Values.controller.scope.namespace }}"
33 verbs:
34 - get
35{{- end }}
36 - apiGroups:
37 - ""
38 resources:
39 - nodes
40 verbs:
41 - get
42 - apiGroups:
43 - ""
44 resources:
45 - services
46 verbs:
47 - get
48 - list
49 - watch
50 - apiGroups:
51 - networking.k8s.io
52 resources:
53 - ingresses
54 verbs:
55 - get
56 - list
57 - watch
58 - apiGroups:
59 - ""
60 resources:
61 - events
62 verbs:
63 - create
64 - patch
65 - apiGroups:
66 - networking.k8s.io
67 resources:
68 - ingresses/status
69 verbs:
70 - update
71 - apiGroups:
72 - networking.k8s.io
73 resources:
74 - ingressclasses
75 verbs:
76 - get
77 - list
78 - watch
79{{- end }}
80
81{{- end }}