Skip to content

reduce RBACs: AppWrapper does not patch or update wrapped resources #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ rules:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
Expand Down Expand Up @@ -69,8 +67,6 @@ rules:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- authorization.k8s.io
Expand All @@ -87,8 +83,6 @@ rules:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- jobset.x-k8s.io
Expand All @@ -99,8 +93,6 @@ rules:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
Expand All @@ -111,8 +103,6 @@ rules:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ray.io
Expand All @@ -124,8 +114,6 @@ rules:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- scheduling.sigs.k8s.io
Expand All @@ -137,8 +125,6 @@ rules:
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- workload.codeflare.dev
Expand Down
19 changes: 9 additions & 10 deletions internal/controller/appwrapper/appwrapper_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,15 @@ type componentStatusSummary struct {
// permission for events
//+kubebuilder:rbac:groups="",resources=events,verbs=create;watch;update;patch

// permission to edit wrapped resources: pods, services, jobs, podgroups, pytorchjobs, rayclusters, jobsets

//+kubebuilder:rbac:groups="",resources=pods;services,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=apps,resources=deployments;statefulsets,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=scheduling.sigs.k8s.io,resources=podgroups,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=scheduling.x-k8s.io,resources=podgroups,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=kubeflow.org,resources=pytorchjobs,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=ray.io,resources=rayclusters;rayjobs,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=jobset.x-k8s.io,resources=jobsets,verbs=get;list;watch;create;update;patch;delete
// permission for wrapped resources: pods, services, jobs, podgroups, pytorchjobs, rayclusters, jobsets
//+kubebuilder:rbac:groups="",resources=pods;services,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=apps,resources=deployments;statefulsets,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=scheduling.sigs.k8s.io,resources=podgroups,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=scheduling.x-k8s.io,resources=podgroups,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=kubeflow.org,resources=pytorchjobs,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=ray.io,resources=rayclusters;rayjobs,verbs=get;list;watch;create;delete
//+kubebuilder:rbac:groups=jobset.x-k8s.io,resources=jobsets,verbs=get;list;watch;create;delete

// Reconcile reconciles an appwrapper
// Please see [aw-states] for documentation of this method.
Expand Down
Loading