Skip to content

Commit 40b4daf

Browse files
committed
✨ feat(k8sgpt-rbac.yaml): add new RBAC configuration for k8sgpt operator
The new RBAC configuration file is added to define the permissions for the k8sgpt operator. This includes a ClusterRole, a ClusterRoleBinding, and a ServiceAccount. The ClusterRole defines the permissions that the operator has, such as creating, listing, getting, watching, and deleting resources. The ClusterRoleBinding binds the ClusterRole to the ServiceAccount, which represents the operator in the Kubernetes cluster. This setup ensures that the operator has the necessary permissions to function correctly, improving the security and functionality of the application. Signed-off-by: MateSousa <[email protected]>
1 parent 7fedf7c commit 40b4daf

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: {{ include "chart.fullname" . }}-operator-role
5+
labels:
6+
{{- include "chart.labels" . | nindent 4 }}
7+
rules:
8+
- apiGroups:
9+
- '*'
10+
resources:
11+
- '*'
12+
verbs:
13+
- create
14+
- list
15+
- get
16+
- watch
17+
- delete
18+
- apiGroups:
19+
- apiextensions.k8s.io
20+
resources:
21+
- '*'
22+
verbs:
23+
- '*'
24+
---
25+
apiVersion: rbac.authorization.k8s.io/v1
26+
kind: ClusterRoleBinding
27+
metadata:
28+
name: {{ include "chart.fullname" . }}-operator-rolebinding
29+
labels:
30+
{{- include "chart.labels" . | nindent 4 }}
31+
roleRef:
32+
apiGroup: rbac.authorization.k8s.io
33+
kind: ClusterRole
34+
name: {{ include "chart.fullname" . }}-operator-role
35+
subjects:
36+
- kind: ServiceAccount
37+
name: "k8sgpt
38+
namespace: {{ .Release.Namespace }}
39+
---
40+
apiVersion: v1
41+
kind: ServiceAccount
42+
metadata:
43+
name: "k8sgpt"
44+
labels:
45+
app.kubernetes.io/component: rbac
46+
app.kubernetes.io/created-by: k8sgpt-operator
47+
app.kubernetes.io/part-of: k8sgpt-operator
48+
{{- include "chart.labels" . | nindent 4 }}

0 commit comments

Comments
 (0)