-
Notifications
You must be signed in to change notification settings - Fork 118
Support providing the driver URI from an external controller #140
Comments
@mccheah instead of an external IP do you mean an external URI? So change the labels to Additionally I suspect that there's a k8s scheme to labels that we should be following. Something like |
Another tricky thing is that there's two URIs that need to be resolved - the Spark UI and the driver submission port. Perhaps the one annotation should be the base path of both of these components and then we fill in the rest of the path consistently, maybe with |
There is a discussion about convention here: kubernetes/kubernetes#30822, but I don't know of any docs. |
@mccheah Do the two URLs have to be related necessarily? I can imagine people wanting to keep them separate, perhaps one serving over the apiserver proxy and the other using some custom ingress based solution. |
They do not necessarily have to be related - but the user would have to provide two annotations, and the driver submission specific URI seems to be an implementation detail I suppose. |
Although I suppose for the driver submission, it only strictly needs the driver submission base path. So we can make the contract only require this annotation but recommend in the docs that the user also configure a route to the Spark UI. |
Yeah. The submission URI is an implementation detail which a user shouldn't need access to. The UI port is part of the status, so, it should ideally live in the SparkJob TPR which lets us expose it to the user. |
@foxish there's another option here where we can provide a Java interface that can be service-loaded to provide the Service's external URI. We could make the default and only implementation we ship with as being the NodePort approach as we do currently. A custom implementation could for example use Ingress resources as was done in #70. Thoughts? |
If we think that the original model outlined above is a useful general implementation as well then we can also ship with that. |
That seems fine to me. Is there some advantage of using the service-loader approach over the annotation? |
It can be done entirely in-process so doesn't require the setup/maintenance/resources of the controller that responds to the annotation in an environment-specific way. |
I see. Your particular implementation would create an ingress rule, wait for its readiness and then return that I imagine. That "plugin" could even be published separately? That sounds fine to me and it seems like it would simplify your use case. Do you envision the service-loader mechanism coexisting with the annotation? The existence of the annotation makes sense to me because it is an extension point that doesn't require knowledge of scala, or the k8s client abstractions to use. |
The service-loader and the annotation-based controller approaches can exist independently -- we're more interested in the first but can create both for greater flexibility. The second is already on its way in #147 |
Inspired by #70, a use case @ash211 and I are working with requires the driver to be accessed in a manner other than
NodePort
. We proposed using an Ingress resource at first, but this primitive is not quite the right tool for the situation.Instead, from that ticket, we came up with the following solution:
spark.kubernetes.driver.useExternalUriProvider
false
, submit the driver using the NodePort service as currently implementedspark/provideExternalIp
. The service would be created with typeClusterIP
.spark/provideExternalUri
. If such a service is created, this external component would be expected to patch the service with another annotation:spark/resolvedExternalUri
. The value of this annotation is the external URI that should be used by the client to route the application submission request to the driver pod.This can all be done without any dependency on the third party resource. The user does have to provide their own implementation of the external component, but in this case the API for the driver to receive an externally-routable URI is well-defined.
The text was updated successfully, but these errors were encountered: