Add RBAC support for cross-namespace secret reading#6919
Add RBAC support for cross-namespace secret reading#6919machichima merged 4 commits intoflyteorg:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6919 +/- ##
=======================================
Coverage 58.55% 58.56%
=======================================
Files 701 701
Lines 41100 41100
=======================================
+ Hits 24068 24069 +1
+ Misses 14911 14910 -1
Partials 2121 2121
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ret reading Add optional ClusterRole and ClusterRoleBinding to the flyteconnector Helm chart, enabling the connector to read secrets from workflow namespaces for per-project Databricks token authentication. Disabled by default (rbac.enabled: false) for backward compatibility. Tracking: flyteorg#6911 Signed-off-by: Rohit Sharma <rohitrsh@gmail.com> Made-with: Cursor
52d8448 to
f8c8813
Compare
| @@ -0,0 +1,27 @@ | |||
| {{- if .Values.rbac.enabled }} | |||
| apiVersion: rbac.authorization.k8s.io/v1 | |||
There was a problem hiding this comment.
Should we also use {{- if $.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} here?
There was a problem hiding this comment.
Good catch, updated the ClusterRole to use {{- if $.Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} as well, matching the pattern in flyte-core/propeller/rbac.yaml. Both ClusterRole and ClusterRoleBinding now gracefully fall back to v1beta1 on older clusters.
Address review comment: apply the same rbac.authorization.k8s.io/v1 fallback check to both ClusterRole and ClusterRoleBinding, matching the pattern used in flyte-core/propeller/rbac.yaml. Tracking: flyteorg#6911 Signed-off-by: Rohit Sharma <rohitrsh@gmail.com>
Signed-off-by: Rohit Sharma <rohitrsh@gmail.com>
|
I think the failing test is unrelated to this PR, it also failed on other PRs |
|
Congrats on merging your first pull request! 🎉 |
* feat(charts/flyteconnector): Add RBAC support for cross-namespace secret reading Add optional ClusterRole and ClusterRoleBinding to the flyteconnector Helm chart, enabling the connector to read secrets from workflow namespaces for per-project Databricks token authentication. Disabled by default (rbac.enabled: false) for backward compatibility. Tracking: flyteorg#6911 Signed-off-by: Rohit Sharma <rohitrsh@gmail.com> Made-with: Cursor * feat(charts/flyteconnector): Add APIVersions.Has check to ClusterRole Address review comment: apply the same rbac.authorization.k8s.io/v1 fallback check to both ClusterRole and ClusterRoleBinding, matching the pattern used in flyte-core/propeller/rbac.yaml. Tracking: flyteorg#6911 Signed-off-by: Rohit Sharma <rohitrsh@gmail.com> * chore: Regenerate helm docs and sandbox manifests Signed-off-by: Rohit Sharma <rohitrsh@gmail.com> --------- Signed-off-by: Rohit Sharma <rohitrsh@gmail.com> Co-authored-by: Samhita Alla <aallasamhita@gmail.com>
* feat(charts/flyteconnector): Add RBAC support for cross-namespace secret reading Add optional ClusterRole and ClusterRoleBinding to the flyteconnector Helm chart, enabling the connector to read secrets from workflow namespaces for per-project Databricks token authentication. Disabled by default (rbac.enabled: false) for backward compatibility. Tracking: flyteorg#6911 Signed-off-by: Rohit Sharma <rohitrsh@gmail.com> Made-with: Cursor * feat(charts/flyteconnector): Add APIVersions.Has check to ClusterRole Address review comment: apply the same rbac.authorization.k8s.io/v1 fallback check to both ClusterRole and ClusterRoleBinding, matching the pattern used in flyte-core/propeller/rbac.yaml. Tracking: flyteorg#6911 Signed-off-by: Rohit Sharma <rohitrsh@gmail.com> * chore: Regenerate helm docs and sandbox manifests Signed-off-by: Rohit Sharma <rohitrsh@gmail.com> --------- Signed-off-by: Rohit Sharma <rohitrsh@gmail.com> Co-authored-by: Samhita Alla <aallasamhita@gmail.com>
Tracking issue
Related to #6911
Why are the changes needed?
The Databricks Spark connector now supports Add multi-tenant Databricks token support via cross-namespace K8S secrets, allowing the connector to read Databricks tokens from Kubernetes secrets in workflow namespaces. This enables multi-tenant Databricks access, allowing each Flyte project to use its own Databricks workspace/token.
For this feature to work, the connector's ServiceAccount needs
getpermission onsecretsacross namespaces. Currently, theflyteconnectorHelm chart creates a ServiceAccount but no RBAC resources (ClusterRole / ClusterRoleBinding), so the connector cannot read secrets from workflow namespaces.What changes were proposed in this pull request?
New file:
templates/connector/rbac.yamlAdds an optional
ClusterRoleandClusterRoleBindingfor the flyteconnector ServiceAccount:values.yaml, defaulting togetonsecretsrbac.enabled: true(default:falsefor backward compatibility)Updated:
values.yamlAdded
rbacconfiguration block:Key design decisions:
enabled: falseby default Opt-in to avoid breaking existing deployments that don't need cross-namespace secret accessgetverb Least privilege; nolistorwatchvalues.yamloverridesresourceNamesrestriction Supports both the defaultdatabricks-tokenand custom secret namesHow was this patch tested?
helm template:Verified RBAC disabled by default no ClusterRole/ClusterRoleBinding rendered when
rbac.enabledis omittedVerified cross-namespace secret access after applying:
Setup process
To enable Databricks per-project token support:
Then create secrets in workflow namespaces:
Screenshots
N/A (infrastructure-only change)
Check all the applicable boxes
Related PRs
Docs link
N/A