# Longhorn-UI with Traefik?

**URL:** <https://forums.suse.com/t/longhorn-ui-with-traefik/16742>\
**Category:** SUSE Storage\
**Created:** [March 3, 2020, 1:02pm UTC](https://forums.suse.com/t/longhorn-ui-with-traefik/16742 "2020-03-03T13:02:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsoika](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rsoika/32/6141_2.png) [@rsoika](https://forums.suse.com/u/rsoika)\
**Post date:** [March 3, 2020, 1:02pm UTC](https://forums.suse.com/t/longhorn-ui-with-traefik/16742/1 "2020-03-03T13:02:57Z")

</div>

I am running a self hosted Kubernetes Cluster with a [traefik.io](http://traefik.io) load balancer.  
I installed the longhorn storage solution for kubernetes - everything looks fine. All pods are up and running.

My question is:

How can I publish the longhorn-ui as a service via my existing traefik load balancer?  
I can see that a longhorn-frontend resource is deployed as a LoadBalacer already.

```
$ kubectl get services -n longhorn-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
compatible-csi-attacher ClusterIP 10.102.249.45 <none> 12345/TCP 4m35s
csi-attacher ClusterIP 10.103.251.27 <none> 12345/TCP 4m35s
csi-provisioner ClusterIP 10.108.167.50 <none> 12345/TCP 4m35s
longhorn-backend ClusterIP 10.100.244.54 <none> 9500/TCP 5m3s
longhorn-frontend LoadBalancer 10.106.215.216 <pending> 80:32699/TCP 5m3s

```

Can anybody give me a hint how to setup the longhorn-ui with trafik?

===  
Ralph

---

<div class="post-metadata">

**Author:** ![rsoika](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rsoika/32/6141_2.png) [@rsoika](https://forums.suse.com/u/rsoika)\
**Post date:** [March 3, 2020, 3:04pm UTC](https://forums.suse.com/t/longhorn-ui-with-traefik/16742/2 "2020-03-03T15:04:05Z")

</div>

I managed it to route the longhorn-ui via my traefik. So I can answer my question by myself. Here is my receipt:

1.) first remove the default service provided by Longhorn deployment:

```
$ kubectl delete service longhorn-frontend -n longhorn-system

```

2.) next create a service definition (longhorn-service.yaml)

```auto
apiVersion: v1
kind: Service
metadata:
  labels:
    app: longhorn-ui
  name: longhorn-frontend
  namespace: longhorn-system
spec:
  ports:
  - port: 8000
    protocol: TCP
    targetPort: 8000
    name: web
  selector:
    app: longhorn-ui

```

apply it:

```
$ kubectl apply -f longhorn-service.yaml    

```

3.) define a Ingress for traefik loadBalancer (longhorn-ingress.yaml)

```auto
kind: IngressRoute
apiVersion: traefik.containo.us/v1alpha1
metadata:
  name: longhorn-frontend
  namespace: longhorn-system

spec:
  entryPoints: 
    - web
  routes:
  - match: Host(`{YOUR-DNS}`) 
    kind: Rule
    services:
    - name: longhorn-frontend
      port: 8000

```

Replace the {YOUR-DNS} with a DNS pointing to your cluster:

apply it:

```
$ kubectl apply -f longhorn-ingress.yaml   

```

Now you can access the longhorn-ui via

```
http://YOUR-DNS/
```
