Skip to content

[SPARK-58893][UI] Fix Spark UI multi-cluster reverse proxy: propagate… - #58243

Open
Nflrijal wants to merge 1 commit into
apache:branch-4.0from
Nflrijal:fix/SPARK-58893-multicluster-proxy
Open

[SPARK-58893][UI] Fix Spark UI multi-cluster reverse proxy: propagate…#58243
Nflrijal wants to merge 1 commit into
apache:branch-4.0from
Nflrijal:fix/SPARK-58893-multicluster-proxy

Conversation

@Nflrijal

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

When spark.ui.reverseProxy=true is enabled in Standalone multi-cluster deployments:

  1. SparkContext on the driver did not receive UI_REVERSE_PROXY_URL, causing driver UI links to drop /proxy/<id> prefixes. This PR propagates UI_REVERSE_PROXY_URL (or falls back to spark.ui.proxyBase) into system property spark.ui.proxyBase.
  2. Master did not pass -Dspark.ui.reverseProxyUrl=<url> to DriverDescription javaOpts. This PR updates Master to inject reverseProxyUrl into driver javaOpts when reverse proxy is enabled.
  3. /app/kill and /driver/kill redirect Location headers were redirecting to / instead of reverseProxyUrl + "/". This PR updates MasterWebUI redirect handlers to preserve reverse proxy paths.
  4. UIUtils.prependBaseUri and uiRoot were updated to handle request = null safely.

Note: Please backport to master, branch-4.1, and branch-3.5 if applicable.

Why are the changes needed?

Without these changes, multi-cluster reverse proxy deployments lose proxy prefixes when accessing driver UIs or terminating applications/drivers from Master UI, breaking navigation and reverse proxy routing.

Does this PR introduce any user-facing change?

No API changes. Fixes UI navigation links and redirect Location headers when spark.ui.reverseProxy=true is enabled.

How was this patch tested?

  • Added unit tests in UIUtilsSuite, MasterSuite, MasterWebUISuite, and SparkContextSuite.
  • Verified local build and unit tests using build/sbt "core/testOnly org.apache.spark.ui.UIUtilsSuite org.apache.spark.deploy.master.MasterSuite org.apache.spark.deploy.master.ui.MasterWebUISuite org.apache.spark.SparkContextSuite".

Was this patch authored or co-authored using generative AI tooling?

No.

… reverseProxyUrl to driver, fix redirect Location and kill button
@Nflrijal

Copy link
Copy Markdown
Contributor Author

Hi @dongjoon-hyun,
Can you please take a look when you get a chance? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant