apache / kyuubi

Apache Kyuubi is a distributed and multi-tenant gateway to provide serverless SQL on data warehouses and lakehouses.
https://kyuubi.apache.org/
Apache License 2.0
2.08k stars 906 forks source link

[Improvement] Is it possible to dynamically add backend service to ingress with Kubernetes? #6102

Open melin opened 7 months ago

melin commented 7 months ago

Code of Conduct

Search before asking

What would you like to be improved?

spark on k8s runs multiple spark apps at the same time. proxy/[sparkappid] path, forwarding to different sparkapp ui console based on sparkappid. spark apps are dynamically added and decreased. ingress Dynamically adds spark svc.

sparkappid == spark svc name

https://matthewpalmer.net/kubernetes-app-developer/articles/kubernetes-ingress-guide-nginx-example.html

@pan3793

How should we improve?

No response

Are you willing to submit PR?

pan3793 commented 6 months ago

It can be achieved by implementing a KubernetesDriverCustomFeatureConfigStep, with an additional change SPARK-40763.

Kyuubi also implemented the Spark Web UI proxy in another approach https://github.com/apache/kyuubi/pull/4795

zwangsheng commented 6 months ago

My guess is that your requirement is to have an ingress as a proxy entry for all spark app ui, with each spark app configured with a subpath on ingress.

But for now we can't assume the spark service name, https://github.com/apache/spark/blob/36299f1b2bff8c892624bc5c0e4c00ea3f261532/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverServiceFeatureStep.scala#L42-L52.

The spark driver service name is not reachable for now, and SPARK-40763 try to fix. Without this patch, we hard to add ingress feature step in kyuubi to proxy spark ui.

If you have good idea, be willing to listen. :)