Skip to content

Conversation

@dejanzele
Copy link
Member

What type of PR is this?

Enhancement

What this PR does / why we need it:

Adds comprehensive oauth2-proxy sidecar support for Spark Driver UI authentication.

OAuth2-proxy Integration: Implements native OAuth2-proxy sidecar containers with 35+ configuration options, supporting OIDC discovery, custom providers, and secure cookie management. Enables authenticated access to Spark Driver UI through configurable authentication providers.

Ingress Support: Adds TLS-enabled ingress configuration with intelligent port routing - OAuth proxy serves on port 4180, Spark UI on port 4040, with proper precedence resolution (CLI > Template > Default).

Does this PR introduce a user-facing change?

Check the docs/architecture.md and docs/ui.md for changes.

spark.armada.oauth contains configuration settings for the oauth proxy.


val finalPodSpecWithOAuth = currentPodSpec
.withRestartPolicy("Never")
.withTerminationGracePeriodSeconds(0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to use the value of spark.kubernetes.appKillPodDeletionGracePeriod here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add it, but in the long run, I don't like the pattern where we reuse kubernetes configs as we do a mix-and-match between spark.armada and spark.kubernetes

Comment on lines 33 to 42
val resources = new ResourceRequirements()
val limits = new HashMap[String, Quantity]()
limits.put("cpu", new Quantity("64m"))
limits.put("memory", new Quantity("64Mi"))
resources.setLimits(limits)

val requests = new HashMap[String, Quantity]()
requests.put("cpu", new Quantity("64m"))
requests.put("memory", new Quantity("64Mi"))
resources.setRequests(requests)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 64m looks unusual for CPU resource:

Suggested change
val resources = new ResourceRequirements()
val limits = new HashMap[String, Quantity]()
limits.put("cpu", new Quantity("64m"))
limits.put("memory", new Quantity("64Mi"))
resources.setLimits(limits)
val requests = new HashMap[String, Quantity]()
requests.put("cpu", new Quantity("64m"))
requests.put("memory", new Quantity("64Mi"))
resources.setRequests(requests)
val resources = new ResourceRequirements()
val limits = new HashMap[String, Quantity]()
limits.put("cpu", new Quantity("100m"))
limits.put("memory", new Quantity("64Mi"))
resources.setLimits(limits)
val requests = new HashMap[String, Quantity]()
requests.put("cpu", new Quantity("100m"))
requests.put("memory", new Quantity("64Mi"))
resources.setRequests(requests)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a lot of CPU for the oauth proxy, it works just fine with 64m, doesn't get any benefit with the additional 36 millicores, nor it helps accounting in Armada.

Only benefit would be cosmetic due to a round number.

@dejanzele dejanzele force-pushed the feat/oauth-sidecar-support branch from b2b084f to 7e12f10 Compare November 3, 2025 17:19
@dejanzele dejanzele force-pushed the feat/oauth-sidecar-support branch 4 times, most recently from 60163cb to 87da29f Compare December 11, 2025 11:21
@dejanzele dejanzele force-pushed the feat/oauth-sidecar-support branch 5 times, most recently from 4552e2d to cb8faad Compare January 15, 2026 16:38
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
@dejanzele dejanzele force-pushed the feat/oauth-sidecar-support branch 2 times, most recently from a30b0ff to cf86a08 Compare January 15, 2026 17:28
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
@dejanzele dejanzele force-pushed the feat/oauth-sidecar-support branch from cf86a08 to 2b7f3b1 Compare January 15, 2026 17:38
val allInitContainers = currentPodSpec.initContainers
val sidecars = extractSidecarContainers(Some(currentPodSpec))
val oauthSidecar = OAuthSidecarBuilder.buildOAuthSidecar(conf)
val allInitContainers = currentPodSpec.initContainers ++ oauthSidecar.toSeq
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oauth is a sidecar container, but it is being added as an init container? why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Native sidecars are configured as init containers with restartPolicy: Always which starts them during init phase but their lifecycle continues along the main container - https://kubernetes.io/blog/2023/08/25/native-sidecar-containers/#what-are-sidecar-containers-in-1-28

Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
Copy link
Collaborator

@GeorgeJahad GeorgeJahad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @dejanzele

@dejanzele dejanzele merged commit 271a002 into master Jan 19, 2026
12 checks passed
@dejanzele dejanzele deleted the feat/oauth-sidecar-support branch January 19, 2026 19:09
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.

4 participants