[SPARK-56275] Set appProtocol on spark-connect service port#599
[SPARK-56275] Set appProtocol on spark-connect service port#599j1wonpark wants to merge 1 commit intoapache:mainfrom
Conversation
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Please don't reference a 3rd party library inside ASF project because we are independent projects and respect their IPs. We don't want to copy and paste from someone-else's effort, @j1wonpark .
See also: kubeflow/spark-operator#2823
|
@dongjoon-hyun |
|
Unfortunately, this PR seems to be generated by the hallucination . Have you use this code in your company production, @j1wonpark ? |
Thank you for the feedback. You're right that hardcoding http is incorrect when SSL is enabled — I overlooked that Spark can handle SSL internally via We haven't used this in production yet. We're currently testing the operator with Istio, and the primary motivation was appProtocol: grpc on the I'd like to revise this PR to only set appProtocol on ports where the value is unambiguous regardless of SSL settings: tcp for RPC/block-manager ports and grpc for |
|
Shall we focus on |
Signed-off-by: Jiwon Park <[email protected]>
b9c1e43 to
89b4afa
Compare
|
@dongjoon-hyun Thank you for the guidance! Narrowed the scope to only set |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Hi, @j1wonpark .
For this one, I reviewed again but I'd like to recommend you to make a PR to the main Apache Spark repository for DriverServiceFeatureStep class instead of here. You can revise the JIRA issue, SPARK-56275, as a subtask of SPARK-54137 .
Here is the original code.
I can help you there.
What changes were proposed in this pull request?
Set
appProtocolto"grpc"on the Spark Connect driver service port (spark-connect) inSparkAppResourceSpec. Ports that already have anappProtocolset by the user are left unchanged.Why are the changes needed?
Without
appProtocol: grpc, service meshes (e.g. Istio, Linkerd) treat gRPC traffic as opaque TCP. This prevents L7-aware load balancing, protocol-specific retries, and proper gRPC health checking for Spark Connect sessions.This change is limited to the
spark-connectport because gRPC is unambiguous regardless of SSL configuration. Other ports (HTTP-based) are left untouched since their protocol depends onspark.ssl.*settings and will be addressed separately.Does this PR introduce any user-facing change?
No. The
appProtocolfield is advisory and has no effect in environments without a service mesh.How was this patch tested?
testSparkConnectAppProtocol: verifies thespark-connectport receivesappProtocol: "grpc"and other ports remain unset.testSparkConnectPreservesExistingAppProtocol: verifies that a pre-existingappProtocolvalue is not overwritten.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.6