Skip to content

Commit

Permalink
Add operations on daemonsets to cluster role
Browse files Browse the repository at this point in the history
Operator fails to reconcile on the MaintenanceRequest,
stating it can't access daemonsets

Signed-off-by: amaslennikov <[email protected]>
  • Loading branch information
almaslennikov committed Sep 16, 2024
1 parent 810ab7b commit 25f6907
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ rules:
- list
- patch
- update
- apiGroups:
- apps
resources:
- daemonsets
verbs:
- get
- list
- watch
- apiGroups:
- maintenance.nvidia.com
resources:
Expand Down
9 changes: 9 additions & 0 deletions deployment/maintenance-operator-chart/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ rules:
- get
- patch
- update
- apiGroups:
- apps
resources:
- daemonsets
verbs:
- get
- list
- watch

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
1 change: 1 addition & 0 deletions internal/controller/nodemaintenance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type NodeMaintenanceReconciler struct {
//+kubebuilder:rbac:groups="",resources=nodes,verbs=get;update;patch
//+kubebuilder:rbac:groups="",resources=pods,verbs=get;watch;list;update;patch;delete
//+kubebuilder:rbac:groups="",resources=pods/eviction,verbs=create;get;list;update;patch;delete
//+kubebuilder:rbac:groups="apps",resources=daemonsets,verbs=get;watch;list

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
Expand Down

0 comments on commit 25f6907

Please sign in to comment.