Skip to content

Commit ab86561

Browse files
authored
fix: add bind and escalate verbs to RBAC for Helm chart installation
1 parent a7be326 commit ab86561

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

config/rbac/role.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ rules:
155155
- rolebindings
156156
- roles
157157
verbs:
158+
- bind
158159
- create
159160
- delete
161+
- escalate
160162
- get
161163
- list
162164
- patch

internal/controller/gpu_controller.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ type GpuReconciler struct {
8181
// and Helm must apply those during install and upgrade. Without this grant, Helm fails with
8282
// a 403 when applying chart resources.
8383
//
84-
// The escalate and bind verbs are intentionally omitted. Kubernetes RBAC performs escalation
85-
// checks during authorization, preventing creation of roles with permissions beyond the
86-
// caller's effective permissions - even with create/update on RBAC resources. This is a
87-
// mitigation, not a guarantee: it applies within standard RBAC authorization checks and
88-
// does not substitute for keeping the permissions listed here minimal.
84+
// The escalate and bind verbs are required because the NVIDIA GPU Operator chart creates
85+
// ClusterRoles (e.g. gpu-operator, node-feature-discovery-worker) that include permissions
86+
// the controller itself holds. Kubernetes blocks granting permissions not currently held by
87+
// the caller unless escalate is present; bind is required to create ClusterRoleBindings that
88+
// reference those roles. Without these verbs, Helm fails with a 403 during chart install.
8989
// See: https://kubernetes.io/docs/reference/access-authn-authz/rbac/#privilege-escalation-prevention-and-bootstrapping
9090

9191
// +kubebuilder:rbac:groups=gpu.kyma-project.io,resources=gpus,verbs=get;list;watch;create;update;patch;delete
@@ -98,7 +98,7 @@ type GpuReconciler struct {
9898
// +kubebuilder:rbac:groups=apps,resources=deployments;daemonsets,verbs=get;list;watch;create;update;patch;delete
9999
// +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete
100100
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch;create;update;patch;delete
101-
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles;clusterrolebindings;roles;rolebindings,verbs=get;list;watch;create;update;patch;delete
101+
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles;clusterrolebindings;roles;rolebindings,verbs=get;list;watch;create;update;patch;delete;bind;escalate
102102
// +kubebuilder:rbac:groups=nvidia.com,resources=clusterpolicies;nvidiadrivers,verbs=get;list;watch;create;update;patch;delete
103103
// +kubebuilder:rbac:groups=nfd.k8s-sigs.io,resources=nodefeaturerules,verbs=get;list;watch;create;update;patch;delete
104104
// +kubebuilder:rbac:groups=policy,resources=poddisruptionbudgets,verbs=get;list;watch;create;update;patch;delete

0 commit comments

Comments
 (0)