Skip to content

Conversation

@turboFei
Copy link
Member

@turboFei turboFei commented Jul 18, 2025

Why are the changes needed?

We are using virtual-kubelet for spark on kubernetes, and spark kubernetes pods would be allocated across kubernetes clusters.

And we use the driver POD ip as driver host, see apache/spark#40392, which is supported since spark-3.5.

The kubernetes context and namespace are virtual and we can not build the app URL by spark driver svc.

And the spark driver pod IP is accessible for our use case, so raise this PR to build the spark app url by spark driver pod id and spark ui port.

How was this patch tested?

UT.

image image

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

No.

@turboFei turboFei changed the title spark driver pod ip Support to get spark app url with pattern http://{{SPARK_DRIVER_POD_IP}}:{{SPARK_UI_PORT}} Jul 18, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2025

Codecov Report

❌ Patch coverage is 0% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (a1a08e7) to head (1277952).
⚠️ Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
...kyuubi/engine/KubernetesApplicationOperation.scala 0.00% 47 Missing ⚠️
...kyuubi/engine/KubernetesApplicationUrlSource.scala 0.00% 2 Missing ⚠️
...in/scala/org/apache/kyuubi/config/KyuubiConf.scala 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #7141   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         700     701    +1     
  Lines       43454   43500   +46     
  Branches     5883    5895   +12     
======================================
- Misses      43454   43500   +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pan3793
Copy link
Member

pan3793 commented Jul 18, 2025

LGTM, one question, SPARK-42769 is only available since Spark 3.5, do we need to write something in docs for these requirements?

@turboFei
Copy link
Member Author

turboFei commented Jul 18, 2025

LGTM, one question, SPARK-42769 is only available since Spark 3.5, do we need to write something in docs for these requirements?

Not necessary, this PR can also work with any spark version that supports spark on kubernetes.
the podIp and pod container port are available in the pod.

SPARK-42769 is only for executors to connect to driver via IP.

@turboFei turboFei requested a review from pan3793 July 18, 2025 17:34
@turboFei
Copy link
Member Author

Have updated the PR desc.

And we use the driver POD ip as driver host, see https://github.com/apache/spark/pull/40392, which is supported since spark-3.5.

Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

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

I see, Pod IP is retrieved by K8s client

@pan3793 pan3793 added this to the v1.11.0 milestone Jul 21, 2025
@pan3793 pan3793 closed this in a3f1e51 Jul 21, 2025
turboFei added a commit to turboFei/kyuubi that referenced this pull request Aug 27, 2025
…//{{SPARK_DRIVER_POD_IP}}:{{SPARK_UI_PORT}}`

### Why are the changes needed?

We are using [virtual-kubelet](https://github.com/virtual-kubelet/virtual-kubelet) for spark on kubernetes, and spark kubernetes pods would be allocated across kubernetes clusters.

And we use the driver POD ip as driver host, see apache/spark#40392, which is supported since spark-3.5.

The kubernetes context and namespace are virtual and we can not build the app URL by spark driver svc.

And the spark driver pod IP is accessible for our use case, so raise this PR to build the spark app url by spark driver pod id and spark ui port.

### How was this patch tested?

UT.

<img width="1532" height="626" alt="image" src="https://github.com/user-attachments/assets/5cb54602-9e79-40b7-b51c-0b873c17560b" />
<img width="710" height="170" alt="image" src="https://github.com/user-attachments/assets/6d1c9580-62d6-423a-a04f-dc6cdcee940a" />

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

No.

Closes apache#7141 from turboFei/app_url_v2.

Closes apache#7141

1277952 [Wang, Fei] VAR
d15e6be [Cheng Pan] Update kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala
1535e00 [Wang, Fei] spark driver pod ip

Lead-authored-by: Wang, Fei <[email protected]>
Co-authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants