-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add oauth2-proxy sidecar support #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| val finalPodSpecWithOAuth = currentPodSpec | ||
| .withRestartPolicy("Never") | ||
| .withTerminationGracePeriodSeconds(0) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
src/main/scala/org/apache/spark/deploy/armada/submit/ArmadaClientApplication.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/apache/spark/deploy/armada/submit/ArmadaClientApplication.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/apache/spark/deploy/armada/submit/ArmadaClientApplication.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/apache/spark/deploy/armada/submit/OAuthSidecarBuilder.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/apache/spark/deploy/armada/submit/OAuthSidecarBuilder.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/apache/spark/deploy/armada/submit/PodMerger.scala
Outdated
Show resolved
Hide resolved
src/main/scala/org/apache/spark/deploy/armada/submit/PodMerger.scala
Outdated
Show resolved
Hide resolved
| 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) |
There was a problem hiding this comment.
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:
| 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) |
There was a problem hiding this comment.
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.
src/test/scala/org/apache/spark/deploy/armada/e2e/featurestep/ExecutorFeatureStep.scala
Outdated
Show resolved
Hide resolved
b2b084f to
7e12f10
Compare
60163cb to
87da29f
Compare
4552e2d to
cb8faad
Compare
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
a30b0ff to
cf86a08
Compare
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
cf86a08 to
2b7f3b1
Compare
| val allInitContainers = currentPodSpec.initContainers | ||
| val sidecars = extractSidecarContainers(Some(currentPodSpec)) | ||
| val oauthSidecar = OAuthSidecarBuilder.buildOAuthSidecar(conf) | ||
| val allInitContainers = currentPodSpec.initContainers ++ oauthSidecar.toSeq |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
GeorgeJahad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @dejanzele
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.mdanddocs/ui.mdfor changes.spark.armada.oauthcontains configuration settings for the oauth proxy.