<p>First of all I'm pretty new on all this (kubernetes, ingress, spark/zeppelin ...) so my apologies if this is obvious. I tried searching here, documentations etc but couldn't find anything.</p>
<p>I am trying to make the spark interpreter ui accessible from my zeppelin notebook running on kubernetes.
Following what I understood from here: <a href="http://zeppelin.apache.org/docs/0.9.0-preview1/quickstart/kubernetes.html" rel="nofollow noreferrer">http://zeppelin.apache.org/docs/0.9.0-preview1/quickstart/kubernetes.html</a>, my ingress yaml looks something like this:</p>
<p>Ingress.yaml</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-zeppelin-server-http
http
spec:
  rules:
  - host: my-zeppelin.my-domain
    http:
      paths:
      - backend:
          serviceName: zeppelin-server
          servicePort: 8080
  - host: '*.my-zeppelin.my-domain'
    http:
      paths:
      - backend:
          serviceName: spark-guovyx
          servicePort: 4040
status:
  loadBalancer: {}
</code></pre>
<p>My issue here is that I need to rely on the service-name (in this case spark-guovyx) being set to the interpreter pod name in order to have the UI show up. However since this name is bound to change / have different ones (i.e. I have one interpreter per user + interpreters are frequently restarted) obviously I cannot rely on setting it manually. My initial thought was to use some kind of wildcard naming for the serviceName but turns out ingress/kubernetes don't support that. Any ideas please ?</p>
<p>Thanks.</p>

<p>You can create a new service and leverage the <strong>interpreterSettingName</strong> label of the spark master pod. When zeppelin creates a master spark pod it adds this label and its value is <strong>spark</strong>. I am not sure if it will work for more than one pods in a per user per interpreter setting. Below is the code for service, do let me know how it behaves for per user per interpreter.</p>
<pre class="lang-yaml prettyprint-override"><code>kind: Service
apiVersion: v1
metadata:
  name: sparkUI
spec:
  ports:
    - name: spark-ui
      protocol: TCP
      port: 4040
      targetPort: 4040
  selector:
    interpreterSettingName: spark
  clusterIP: None
  type: ClusterIP
</code></pre>
<p>And then you can have your ingress as:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-zeppelin-server-http
http
spec:
  rules:
  - host: my-zeppelin.my-domain
    http:
      paths:
      - backend:
          serviceName: zeppelin-server
          servicePort: 8080
  - host: '*.my-zeppelin.my-domain'
    http:
      paths:
      - backend:
          serviceName: sparkUI
          servicePort: 4040
status:
  loadBalancer: {}
</code></pre>
<p>Also do checkout this repo <a href="https://github.com/cuebook/cuelake" rel="nofollow noreferrer">https://github.com/cuebook/cuelake</a>, it is still in early stage of development but would love to hear your feedback.</p>
