# Ingress not routing to Ray Dashboard

**URL:** <https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413>\
**Category:** Kubernetes\
**Created:** [March 15, 2022, 9:43pm UTC](https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413 "2022-03-15T21:43:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kun\_Hwi\_Ko](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kun_hwi_ko/32/2130_2.png) [@Kun\_Hwi\_Ko](https://discuss.ray.io/u/Kun_Hwi_Ko)\
**Post date:** [March 15, 2022, 9:43pm UTC](https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413/1 "2022-03-15T21:43:30Z")

</div>

I am wondering if anyone has been successful in using an ingress to access the Ray dashboard. When I access the browser using the ingress rule, I get a 404 error:

```auto
192.168.65.3 - BA [15/Mar/2022:21:38:15 +0000] "GET /c3/ray HTTP/1.1" 404 14 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36" 1520 0.002 [khk-local-env-app-k8sray-local-ray-head-8265] [] 10.1.2.168:8265 14 0.001 404 89ad533747ec91f3e7b1e96dd343fa7f

```

My ingress controller is using the following:

```auto
registry: k8s.gcr.io
image: ingress-nginx/controller
tag: v.1.1.0

```

Output of `kubectl -o yaml get ingress ...` is:

```auto
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    meta.helm.sh/release-name: app
    meta.helm.sh/release-namespace: khk
    nginx.ingress.kubernetes.io/proxy-body-size: 250m
  creationTimestamp: "2022-03-15T18:26:00Z"
  generation: 7
  labels:
    app: local-env-app
    release: app
  name: local-env-app-k8singr-ray
  namespace: khk
  resourceVersion: "555169"
  uid: e0349a39-c7db-4bff-8cb5-ae8d3bacada9
spec:
  rules:
  - host: dev.platform.com
    http:
      paths:
      - backend:
          service:
            name: local-env-app-k8sray-local-ray-head
            port:
              number: 8265
        path: /app/ray
        pathType: Prefix
status:
  loadBalancer:
    ingress:
    - hostname: localhost

```

My Ray head service looks like:

```auto
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2022-03-15T18:43:12Z"
  name: local-env-app-k8sray-local-ray-head
  namespace: khk
  ownerReferences:
  - apiVersion: cluster.ray.io/v1
    blockOwnerDeletion: true
    controller: true
    kind: RayCluster
    name: local-env-app-k8sray-local
    uid: cf43f6da-f05b-459e-96d5-b213e174b2fb
  resourceVersion: "543577"
  uid: 2b0423df-b8e9-4397-9ba7-441a39dabb88
spec:
  clusterIP: 10.108.179.183
  clusterIPs:
  - 10.108.179.183
  ipFamilies:
  - IPv4
  ipFamilyPolicy: SingleStack
  ports:
  - name: client
    port: 10001
    protocol: TCP
    targetPort: 10001
  - name: dashboard
    port: 8265
    protocol: TCP
    targetPort: 8265
  - name: ray-serve
    port: 8000
    protocol: TCP
    targetPort: 8000
  selector:
    cluster.ray.io/component: local-env-app-k8sray-local-ray-head
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer:
    ingress:
    - hostname: localhost

```

Ray head is currently running

```auto
ray start --head --no-monitor --include-dashboard true --dashboard-host 0.0.0.0

```

**How severe does this issue affect your experience of using Ray?**

- Medium: It contributes to significant difficulty to complete my task, but I can work around it.

---

<div class="post-metadata">

**Author:** ![Kun\_Hwi\_Ko](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kun_hwi_ko/32/2130_2.png) [@Kun\_Hwi\_Ko](https://discuss.ray.io/u/Kun_Hwi_Ko)\
**Post date:** [March 16, 2022, 1:28am UTC](https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413/2 "2022-03-16T01:28:53Z")

</div>

Found something interesting. When I set the ingress path to be:

```auto
      - backend:
          service:
            name: local-env-app-k8sray-local-ray-head
            port:
              number: 8265
        path: /
        pathType: Prefix

```

I can access the dashboard from `dev.platform.com/#`, but not on any other url. Perhaps I missed something here?

---

<div class="post-metadata">

**Author:** ![Kun\_Hwi\_Ko](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kun_hwi_ko/32/2130_2.png) [@Kun\_Hwi\_Ko](https://discuss.ray.io/u/Kun_Hwi_Ko)\
**Post date:** [March 17, 2022, 5:43pm UTC](https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413/3 "2022-03-17T17:43:58Z")

</div>

Got this to work with an nginx rewrite target annotation

---

<div class="post-metadata">

**Author:** ![Ameer\_Haj\_Ali](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ameer_haj_ali/32/279_2.png) [@Ameer\_Haj\_Ali](https://discuss.ray.io/u/Ameer_Haj_Ali)\
**Post date:** [April 25, 2022, 11:49am UTC](https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413/4 "2022-04-25T11:49:16Z")

</div>

Thanks @Kun_Hwi_Ko , please let us know if you need any further help.

---

<div class="post-metadata">

**Author:** ![Dmitri](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/dmitri/32/657_2.png) [@Dmitri](https://discuss.ray.io/u/Dmitri)\
**Post date:** [May 12, 2022, 3:42am UTC](https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413/5 "2022-05-12T03:42:55Z")

</div>

We’ll keep in mind to document network set up for the Ray on K8s on the major cloud providers.

---

<div class="post-metadata">

**Author:** ![kostorub](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@kostorub](https://discuss.ray.io/u/kostorub)\
**Post date:** [December 15, 2023, 10:47am UTC](https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413/6 "2023-12-15T10:47:25Z")

</div>

Could you please share your ingress.yaml file, please. I have the same problem with GCP using GCE.  
Here is my config:

```auto
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ray-external-ingress
  annotations:
    kubernetes.io/ingress.class: "gce"
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
  - http:
      paths:
        - path: /ray-cluster-1/*
          pathType: ImplementationSpecific
          backend:
            service:
              name: ray-cluster-1-head-svc
              port:
                number: 8265

```

---

<div class="post-metadata">

**Author:** ![tppalani](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/tppalani/32/5590_2.png) [@tppalani](https://discuss.ray.io/u/tppalani)\
**Post date:** [January 9, 2024, 5:26pm UTC](https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413/7 "2024-01-09T17:26:48Z")

</div>

HI @Kun_Hwi_Ko would you able to share the sample code for ingress with rewrite ?

---

<div class="post-metadata">

**Author:** ![niks](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@niks](https://discuss.ray.io/u/niks)\
**Post date:** [January 10, 2024, 4:34pm UTC](https://discuss.ray.io/t/ingress-not-routing-to-ray-dashboard/5413/8 "2024-01-10T16:34:30Z")

</div>

Facing a similar issue here. [RayServe application via ingress unreachable - Ray Libraries (Data, Train, Tune, Serve) - Ray](https://discuss.ray.io/t/rayserve-application-via-ingress-unreachable/13357)
