When the batch-engine ConfigMap selects the Ray engine in KubeRay mode
(type: ray.engine, use_kuberay: true), the Feast service pod uses the
CodeFlare SDK to discover RayCluster resources and read mTLS Secrets.
Previously the Feast SA had no permissions on either, so the SDK calls
returned 403 and users had to apply the Role + RoleBinding by hand
before every materialization run.
This change makes the operator provision them automatically:
- New services/ray_rbac.go reads the batch-engine ConfigMap once per
reconcile and, when KubeRay is selected, CreateOrUpdates a
namespace-scoped Role + RoleBinding named feast-<crName>-kuberay
granting the Feast SA:
ray.io/rayclusters: get, list, watch
core/secrets: get, list, watch, create, update, delete
- Both resources are owner-referenced to the FeatureStore so they
GC with the CR. When use_kuberay flips back to false (or the
batchEngine block is removed), they are deleted on the next
reconcile.
- The operator's own kubebuilder RBAC markers are widened to match
so it can hand those verbs to the Feast SA (k8s RBAC escalation
rules require the granter to hold the granted verbs). config/rbac
and dist/install.yaml are regenerated accordingly.
- New ginkgo suite covers create-on-enable, delete-on-disable, and
no-op when batchEngine is absent.
- 06-batch-and-jobs.md documents the new auto-RBAC behavior so users
know manual setup is no longer required.
Fixes feast-dev#6408
Signed-off-by: Aravind Nidadavolu <aravind@aravindn.com>
What this PR does / why we need it:
When a FeatureStore selects the Ray compute engine in KubeRay mode (type: ray.engine, use_kuberay: true), the Feast pod uses the CodeFlare SDK to discover a RayCluster and read mTLS Secrets. Previously the Feast service account had no permissions on ray.io/rayclusters or core/secrets, so every materialization failed with 403 Forbidden and users had to hand-apply a Role + RoleBinding before each deployment.
This PR makes the operator provision that RBAC automatically:
Which issue(s) this PR fixes:
Fixes #6408
Checks
Testing Strategy
Misc
New ginkgo suite at internal/controller/featurestore_controller_kuberay_rbac_test.go covers three reconciler-level flows against an envtest API server:
The operator's full suite (make fmt vet lint test) passes locally with these changes.