Skip to content

Commit e25c5c3

Browse files
fix(rbac): Add missing rbac rules for namespaced fluentbit
Signed-off-by: alexandre.vilain <[email protected]>
1 parent 8458d4d commit e25c5c3

File tree

6 files changed

+82
-2
lines changed

6 files changed

+82
-2
lines changed

charts/fluent-operator/templates/fluent-operator-clusterRole.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,23 @@ rules:
124124
- get
125125
- watch
126126
- patch
127+
- apiGroups:
128+
- rbac.authorization.k8s.io
129+
resources:
130+
- rolebindings
131+
verbs:
132+
- create
133+
- list
134+
- get
135+
- watch
136+
- patch
137+
- apiGroups:
138+
- rbac.authorization.k8s.io
139+
resources:
140+
- roles
141+
verbs:
142+
- create
143+
- list
144+
- get
145+
- watch
146+
- patch

config/rbac/role.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,37 @@ rules:
171171
- clusterrolebindings
172172
verbs:
173173
- create
174+
- list
175+
- get
176+
- watch
177+
- patch
174178
- apiGroups:
175179
- rbac.authorization.k8s.io
176180
resources:
177181
- clusterroles
178182
verbs:
179183
- create
184+
- list
185+
- get
186+
- watch
187+
- patch
188+
- apiGroups:
189+
- rbac.authorization.k8s.io
190+
resources:
191+
- rolebindings
192+
verbs:
193+
- create
194+
- list
195+
- get
196+
- watch
197+
- patch
198+
- apiGroups:
199+
- rbac.authorization.k8s.io
200+
resources:
201+
- roles
202+
verbs:
203+
- create
204+
- list
205+
- get
206+
- watch
207+
- patch

controllers/fluentbit_controller.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ type FluentBitReconciler struct {
4949
// +kubebuilder:rbac:groups=fluentbit.fluent.io,resources=fluentbits;fluentbitconfigs;inputs;filters;outputs,verbs=get;list;watch;create;update;patch;delete
5050
// +kubebuilder:rbac:groups=apps,resources=daemonsets,verbs=get;list;watch;create;update;patch;delete
5151
// +kubebuilder:rbac:groups=core,resources=serviceaccounts,verbs=get;list;watch;create;update;patch;delete
52-
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles,verbs=create
53-
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings,verbs=create
52+
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles,verbs=create;list;get;watch;patch
53+
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings,verbs=create;list;get;watch;patch
54+
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles,verbs=create;list;get;watch;patch
55+
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=rolebindings,verbs=create;list;get;watch;patch
5456
// +kubebuilder:rbac:groups=core,resources=pods,verbs=get
5557

5658
// Reconcile is part of the main kubernetes reconciliation loop which aims to

go.mod

+4
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ require (
6060
go.uber.org/multierr v1.11.0 // indirect
6161
go.uber.org/zap v1.26.0 // indirect
6262
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
63+
golang.org/x/mod v0.17.0 // indirect
6364
golang.org/x/net v0.24.0 // indirect
6465
golang.org/x/oauth2 v0.12.0 // indirect
6566
golang.org/x/sys v0.19.0 // indirect
6667
golang.org/x/term v0.19.0 // indirect
6768
golang.org/x/text v0.14.0 // indirect
6869
golang.org/x/time v0.3.0 // indirect
70+
golang.org/x/tools v0.20.0 // indirect
6971
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
7072
google.golang.org/appengine v1.6.7 // indirect
7173
google.golang.org/protobuf v1.33.0 // indirect
@@ -74,6 +76,8 @@ require (
7476
gopkg.in/yaml.v2 v2.4.0 // indirect
7577
gopkg.in/yaml.v3 v3.0.1 // indirect
7678
k8s.io/apiextensions-apiserver v0.30.1 // indirect
79+
k8s.io/code-generator v0.30.3 // indirect
80+
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
7781
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
7882
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
7983
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect

go.sum

+6
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfU
154154
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
155155
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
156156
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
157+
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
158+
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
157159
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
158160
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
159161
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
@@ -241,6 +243,10 @@ k8s.io/apimachinery v0.30.3 h1:q1laaWCmrszyQuSQCfNB8cFgCuDAoPszKY4ucAjDwHc=
241243
k8s.io/apimachinery v0.30.3/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
242244
k8s.io/client-go v0.30.3 h1:bHrJu3xQZNXIi8/MoxYtZBBWQQXwy16zqJwloXXfD3k=
243245
k8s.io/client-go v0.30.3/go.mod h1:8d4pf8vYu665/kUbsxWAQ/JDBNWqfFeZnvFiVdmx89U=
246+
k8s.io/code-generator v0.30.3 h1:bmtnLJKagDS5f5uOEpLyJiDfIMKXGMKgOLBdde+w0Mc=
247+
k8s.io/code-generator v0.30.3/go.mod h1:PFgBiv+miFV7TZYp+RXgROkhA+sWYZ+mtpbMLofMke8=
248+
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo=
249+
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
244250
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
245251
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
246252
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=

manifests/setup/fluent-operator-clusterRole.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,23 @@ rules:
124124
- get
125125
- watch
126126
- patch
127+
- apiGroups:
128+
- rbac.authorization.k8s.io
129+
resources:
130+
- rolebindings
131+
verbs:
132+
- create
133+
- list
134+
- get
135+
- watch
136+
- patch
137+
- apiGroups:
138+
- rbac.authorization.k8s.io
139+
resources:
140+
- roles
141+
verbs:
142+
- create
143+
- list
144+
- get
145+
- watch
146+
- patch

0 commit comments

Comments
 (0)