This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Description
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:
- Expose a Spark boolean configuration called
spark.kubernetes.driver.useExternalUriProvider
- If the above configuration is set to
false, submit the driver using the NodePort service as currently implemented
- Otherwise, still create the service and pod but place an annotation on the service - say
spark/provideExternalIp. The service would be created with type ClusterIP.
- Some external component that watches the API server can listen to the creation of services created with the annotation
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.
- The submission client waits for the service to have the given annotation be filled in, and uses the value of that annotation as the external URI to route to the driver.
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.