Skip to content

Commit e73b33d

Browse files
authored
Fix(clusterRole): - Remove ConfigMap access entirely from kai-admission, queuecontroller, kai-podgroup-controller, and kai-node-scale-adjuster (#2061)
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
1 parent 79394c6 commit e73b33d

13 files changed

Lines changed: 24 additions & 72 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Fixed
2+
body: tighten configmap verb for admission, nodescaleadjuster, podgroupcontroller, podgrouper, queuecontroller, scheduler ClusterRole
3+
time: 2026-08-11T23:33:07.93807465+01:00
4+
custom:
5+
Author: dttung2905
6+
Issue: "2060"

cmd/admission/app/app.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ func (app *App) RegisterPlugins(admissionPlugins *admissionplugins.KaiAdmissionP
132132
app.admissionPlugins = admissionPlugins
133133
}
134134

135-
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
136135
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete
137136
// +kubebuilder:rbac:groups=core,resources=events,verbs=create;patch;update
138137

cmd/nodescaleadjuster/app/app.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ func init() {
3333
// +kubebuilder:scaffold:scheme
3434
}
3535

36-
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
3736
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete
3837
// +kubebuilder:rbac:groups=core,resources=events,verbs=create;patch;update
3938

cmd/podgroupcontroller/app/app.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func init() {
4848
// +kubebuilder:scaffold:scheme
4949
}
5050

51-
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
5251
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete
5352

5453
func Run(options *Options, config *rest.Config, ctx context.Context) error {

cmd/podgrouper/app/app.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ func (app *App) RegisterPlugins(pluginsHub pluginshub.PluginsHub) {
134134
app.pluginsHub = pluginsHub
135135
}
136136

137-
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
138137
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete
139138

140139
func (app *App) Run() error {

cmd/queuecontroller/app/app.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func init() {
4343
// +kubebuilder:scaffold:scheme
4444
}
4545

46-
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
4746
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete
4847

4948
func Run(opts *Options, clientConfig *rest.Config, ctx context.Context) error {

cmd/scheduler/app/server.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ func setConfig(so *options.ServerOption) {
180180
config.MIGWorkerNodeLabelKey = so.MIGWorkerNodeLabelKey
181181
}
182182

183-
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
184183
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;list;watch;create;update;patch;delete
185184

186185
func Run(ctx context.Context, opt *options.ServerOption, config *restclient.Config, mux *http.ServeMux) error {

deployments/kai-scheduler/templates/rbac/admission.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ kind: ClusterRole
1010
metadata:
1111
name: kai-admission
1212
rules:
13-
- apiGroups:
14-
- ""
15-
resources:
16-
- configmaps
17-
verbs:
18-
- create
19-
- delete
20-
- get
21-
- list
22-
- patch
23-
- update
24-
- watch
2513
- apiGroups:
2614
- ""
2715
resources:

deployments/kai-scheduler/templates/rbac/nodescaleadjuster.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,24 @@ rules:
1313
- apiGroups:
1414
- ""
1515
resources:
16-
- configmaps
17-
- pods
16+
- events
17+
- pods/finalizers
1818
verbs:
1919
- create
20-
- delete
21-
- get
22-
- list
2320
- patch
2421
- update
25-
- watch
2622
- apiGroups:
2723
- ""
2824
resources:
29-
- events
30-
- pods/finalizers
25+
- pods
3126
verbs:
3227
- create
28+
- delete
29+
- get
30+
- list
3331
- patch
3432
- update
33+
- watch
3534
- apiGroups:
3635
- ""
3736
resources:

deployments/kai-scheduler/templates/rbac/podgroupcontroller.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ kind: ClusterRole
1010
metadata:
1111
name: kai-podgroup-controller
1212
rules:
13-
- apiGroups:
14-
- ""
15-
resources:
16-
- configmaps
17-
verbs:
18-
- create
19-
- delete
20-
- get
21-
- list
22-
- patch
23-
- update
24-
- watch
2513
- apiGroups:
2614
- ""
2715
resources:

0 commit comments

Comments
 (0)