Skip to content

Commit

Permalink
update: add missing permissions
Browse files Browse the repository at this point in the history
- some error that kueue, dashboard, TO cannot list resources

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
  • Loading branch information
zdtsw committed Nov 26, 2024
1 parent d748e02 commit 0902cd2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 15 deletions.
27 changes: 20 additions & 7 deletions bundle/manifests/opendatahub-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -836,14 +836,11 @@ spec:
- monitoring.coreos.com
resources:
- alertmanagerconfigs
- alertmanagers
- alertmanagers/finalizers
- alertmanagers/status
- probes
- prometheuses
- prometheuses/finalizers
- prometheuses/status
- thanosrulers
- thanosrulers/finalizers
- thanosrulers/status
verbs:
Expand All @@ -855,26 +852,28 @@ spec:
- apiGroups:
- monitoring.coreos.com
resources:
- podmonitors
- alertmanagers
- probes
- prometheusrules
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- prometheusrules
- podmonitors
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- monitoring.coreos.com
Expand All @@ -889,6 +888,18 @@ spec:
- patch
- update
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- thanosrulers
verbs:
- :list
- create
- delete
- deletecollection
- get
- patch
- watch
- apiGroups:
- networking.istio.io
resources:
Expand Down Expand Up @@ -1162,7 +1173,9 @@ spec:
- create
- delete
- get
- list
- patch
- watch
- apiGroups:
- template.openshift.io
resources:
Expand Down
27 changes: 20 additions & 7 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -588,14 +588,11 @@ rules:
- monitoring.coreos.com
resources:
- alertmanagerconfigs
- alertmanagers
- alertmanagers/finalizers
- alertmanagers/status
- probes
- prometheuses
- prometheuses/finalizers
- prometheuses/status
- thanosrulers
- thanosrulers/finalizers
- thanosrulers/status
verbs:
Expand All @@ -607,26 +604,28 @@ rules:
- apiGroups:
- monitoring.coreos.com
resources:
- podmonitors
- alertmanagers
- probes
- prometheusrules
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- prometheusrules
- podmonitors
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- monitoring.coreos.com
Expand All @@ -641,6 +640,18 @@ rules:
- patch
- update
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- thanosrulers
verbs:
- :list
- create
- delete
- deletecollection
- get
- patch
- watch
- apiGroups:
- networking.istio.io
resources:
Expand Down Expand Up @@ -914,7 +925,9 @@ rules:
- create
- delete
- get
- list
- patch
- watch
- apiGroups:
- template.openshift.io
resources:
Expand Down
11 changes: 10 additions & 1 deletion controllers/datasciencecluster/kubebuilder_rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package datasciencecluster

// +kubebuilder:rbac:groups="apiextensions.k8s.io",resources=customresourcedefinitions,verbs=get;list;watch;create;patch;delete

// +kubebuilder:rbac:groups="snapshot.storage.k8s.io",resources=volumesnapshots,verbs=create;delete;patch;get


// +kubebuilder:rbac:groups="security.openshift.io",resources=securitycontextconstraints,verbs=*,resourceNames=restricted
// +kubebuilder:rbac:groups="security.openshift.io",resources=securitycontextconstraints,verbs=*,resourceNames=anyuid
Expand Down Expand Up @@ -140,6 +140,7 @@ package datasciencecluster
// +kubebuilder:rbac:groups="dashboard.opendatahub.io",resources=odhdocuments,verbs=create;get;patch;list;delete;watch
// +kubebuilder:rbac:groups="dashboard.opendatahub.io",resources=odhapplications,verbs=create;get;patch;list;delete;watch
// +kubebuilder:rbac:groups="dashboard.opendatahub.io",resources=acceleratorprofiles,verbs=create;get;patch;list;delete;watch
// +kubebuilder:rbac:groups="snapshot.storage.k8s.io",resources=volumesnapshots,verbs=create;delete;patch;get;list;watch

// ModelRegistry
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=modelregistries,verbs=get;list;watch;create;update;patch;delete
Expand All @@ -156,6 +157,13 @@ package datasciencecluster
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=kueues/finalizers,verbs=update
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=prometheusrules,verbs=get;create;patch;delete;deletecollection;list;watch
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=podmonitors,verbs=get;create;delete;update;watch;list;patch
// +kubebuilder:rbac:groups="snapshot.storage.k8s.io",resources=volumesnapshots,verbs=create;delete;patch;get;list;watch
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=servicemonitors,verbs=get;create;delete;update;watch;list;patch;deletecollection
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=prometheusrules,verbs=get;create;patch;delete;deletecollection
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=prometheuses,verbs=get;create;patch;delete;deletecollection
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=alertmanagers,verbs=get;create;patch;delete;deletecollection;list;watch
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=thanosrulers,verbs=get;create;patch;delete;deletecollection;:list;watch
// +kubebuilder:rbac:groups="monitoring.coreos.com",resources=probes,verbs=get;create;patch;delete;deletecollection;list;watch

// TODO: CFO
//+kubebuilder:rbac:groups=components.opendatahub.io,resources=codeflares,verbs=get;list;watch;create;update;patch;delete
Expand Down Expand Up @@ -216,6 +224,7 @@ package datasciencecluster
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=trainingoperators,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=trainingoperators/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=trainingoperators/finalizers,verbs=update
// +kubebuilder:rbac:groups="snapshot.storage.k8s.io",resources=volumesnapshots,verbs=create;delete;patch;get;list;watch

// TODO: ModelMesh
// +kubebuilder:rbac:groups=components.opendatahub.io,resources=modelmeshservings,verbs=get;list;watch;create;update;patch;delete
Expand Down

0 comments on commit 0902cd2

Please sign in to comment.