fix(chart): gate main ClusterRole rules by engine and provider - #432
fix(chart): gate main ClusterRole rules by engine and provider#432teerthsharma wants to merge 1 commit into
Conversation
Signed-off-by: teerth sharma <teerth.2428010112@muj.manipal.edu>
Greptile SummaryThis PR narrows the main API-server RBAC resources according to Helm-selected engine and provider combinations.
Confidence Score: 3/5This PR should not merge until RBAC is aligned with every engine and provider that the deployed server can select at request time. A chart installed with a non-Kubernetes combination can omit the main role even though the API server still accepts requests that dispatch to Kubernetes-backed implementations, causing their API calls to be denied. Files Needing Attention: charts/topograph/templates/rbac.yaml, charts/topograph/tests/rbac_test.yaml
|
| Filename | Overview |
|---|---|
| charts/topograph/templates/rbac.yaml | Adds granular RBAC gates, but bases them on Helm values while runtime requests can select a different engine or provider. |
| charts/topograph/tests/rbac_test.yaml | Extensively covers static Helm value combinations but does not cover the deployment's request-time selection model. |
| charts/topograph/tests/snapshot/render_snapshot_test.yaml.snap | Updates rendered snapshots to reflect the narrower default RBAC output. |
| CHANGELOG.md | Documents the new engine/provider-based RBAC behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
H[Helm engine/provider values] --> G[RBAC gates]
G --> R[Rendered or omitted ClusterRole]
Q[Request engine/provider] --> S[API server dispatch]
S --> K[Kubernetes-backed engine/provider]
R -. authorization may not match .-> K
Reviews (1): Last reviewed commit: "fix(chart): gate main ClusterRole by eng..." | Re-trigger Greptile
| {{- if eq $engine "slinky" -}} | ||
| {{- $needsConfigMaps = true -}} | ||
| {{- end -}} | ||
| {{- $hasMainRules := or $needsNodeList $needsNodeWrite $needsPods $needsDaemonSets $needsConfigMaps $needsPodExec -}} |
There was a problem hiding this comment.
Request-time RBAC selection mismatch
When the chart is installed with a combination requiring no Kubernetes permissions, such as slurm with test, this condition omits the main role and binding even though requests can select a Kubernetes-backed engine or provider at runtime, causing those requests to fail with Kubernetes Forbidden errors. How this was verified: Request payloads can override engine and provider selection, while the chart's server ConfigMap does not constrain them to the Helm values used by these gates.
Description
Closes #386.
The main Topograph API server ClusterRole was rendering the same broad Kubernetes RBAC rules regardless of the selected engine or provider. For non-Kubernetes combos (e.g. provider: test with engine: slurm) this granted unnecessary
odes, pods, and daemonsets access to a component that never talks to the Kubernetes API.
Changes
Gate the main ClusterRole rules by engine/provider:
odes only for k8s, slinky,
fd engines and dra/infiniband-k8s providers.
odes update for k8s engine;
odes patch for slinky engine.
Validation
Checklist