<p>I installed a Spark on K8s operator in my K8s cluster and I have an app running within the k8s cluster. I'd like to enable this app to talk to the sparkapplication CRD service. Can I know what would be the endpoint I should use? (or what's the K8s endpoint within a K8s cluster)</p>

<p>It's clearly documented <a href="https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/master/docs/quick-start-guide.md#driver-ui-access-and-ingress" rel="nofollow noreferrer">here</a>. So basically, it creates a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">NodePort</a> type of service. It also specifies that it could create an <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">Ingress</a> to access the UI. For example:</p>

<pre><code>...
status:
  sparkApplicationId: spark-5f4ba921c85ff3f1cb04bef324f9154c9
  applicationState:
    state: COMPLETED
  completionTime: 2018-02-20T23:33:55Z
  driverInfo:
    podName: spark-pi-83ba921c85ff3f1cb04bef324f9154c9-driver
    webUIAddress: 35.192.234.248:31064
    webUIPort: 31064
    webUIServiceName: spark-pi-2402118027-ui-svc
    webUIIngressName: spark-pi-ui-ingress
    webUIIngressAddress: spark-pi.ingress.cluster.com
</code></pre>

<p>In this case, you could use <code>35.192.234.248:31064</code> to access your UI. Internally within the K8s cluster, you could use <code>spark-pi-2402118027-ui-svc.&lt;namespace&gt;.svc.cluster.local</code> or simply <code>spark-pi-2402118027-ui-svc</code> if you are within the same namespace.</p>
