fix(helm): support per-server credentials for Spark History Servers #227
Thank you very much for the PR!
As it is, it adds the same secret value even when there's an in-line value like so:
config:
servers:
default:
default: true
url: "http://spark-history-server:18080"
auth:
username: "u"
password: "p"
So we want to skip the shared secret for a server that has inline auth.
@nabuskey thanks for the review. yeah you're right, the shared secret was being applied to every server without an auth.servers entry so it was silently overriding the inline creds, env vars win over the config file. fixed now, shared secret is skipped for any server that has inline auth under config.servers.<name>.auth. added a test with one inline server and one shared secret server too, helm lint and all 29 chart tests pass
/approve
Thank you very much!
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/kubeflow/mcp-apache-spark-history-server/pull/227#pullrequestreview-5521498007" title="Approved">nabuskey</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
nabuskey
nothariharan
Description
Fixes #94.
The chart could only express one credential set (
auth.secret), so a deployment with several Spark History Servers could not authenticate to more than one of them. On top of that, the injected env vars (SPARK_USERNAME,SPARK_PASSWORD,SPARK_TOKEN,MCP_PORT,MCP_DEBUG) no longer match the names the server reads since theSHS_config refactor, so credentials configured throughauth.secretnever reached the server at all.This adds per-server credentials and wires every credential through the env vars the current server actually reads (
SHS_SERVERS__<SERVER>__AUTH__):Servers without an
auth.serversentry keep using the shared secret (includingexternalsecretandcsisecretstore, which are unchanged). Existing shared-secret values start working for the first time, andauth.secret.namewithcreate: falseis now wired too (previously it injected nothing).Rendering fails with a clear message when:
auth.serverskey does not match anyconfig.serversentrycreate: trueornameType of Change
Testing
task test)Test Commands Run
helm lint: 0 chart(s) failedhelm unittest: 5 suites, 28 tests passed (8 new covered intests/auth_test.yaml, including the three validation errors)Rendered proof, three servers with a shared secret plus one created and one existing per-server secret:
Before (current main):
One Secret rendered, and none of those env names are read by the server.
After:
Secrets rendered:
staging-spark-auth(created),spark-auth(shared).Checklist
Related Issues
Fixes #94