Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug][Helm chart] Path based routing doesn't work for common host

未关闭
#149 6 条评论 2 个 reaction 已指派 1 人 在 GitHub 查看

@ZhangNing10 已经在做这个了。

开始于 2023年12月13日。

评估

这个 Issue 还没有评估数据。

描述

There is an issue with the helm chart for Ingress resources. We are using path based routing for multiple applications with the same host and the way Devlake helm chart creates ingress resource is based on the helm values file and the path is picked from Prefix value of helm chart. Based on how our ingresses are setup, we are supposed to give devlake as prefix. But this option doesn't seem to working since the application is looking for assets in / and throwing a 404 error in logs. So basically I am getting a blank page when I try to access https:///devlake.
helm values file

--
devlake:
  ingress:
    enabled: true
    enableHttps: false
    useDefaultNginx: true
    annotations:
      kubernetes.io/ingress.class: nginx
      kubernetes.io/tls-acme: "true"
    hostname: devlake-hostname.com
    prefix: devlake
    httpPort: 80

Ingress logs

infra-ingress-controller-ingress-nginx-controller-6bc664dbs2svg:controller 172.20.3.79 - - [19/Jun/2023:23:47:53 +0000] "GET /assets/index-afa74f6a.css HTTP/2.0" 404 548 "https://dvlake-hostname.com/devlake" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" 366 0.001 [upstream-default-backend] [] 127.0.0.1:8181 548 0.001 404 1cad31d8fa0f700b151b7624b57aabaa

Ingress resource

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$2
  generation: 3
  name: devlake
  namespace: devlake
spec:
  rules:
  - host: devlake-hostname.com
    http:
      paths:
      - backend:
          service:
            name: devlake-grafana
            port:
              number: 3000
        path: /devlake/grafana(/|$)(.*)
        pathType: Prefix
      - backend:
          service:
            name: devlake-ui
            port:
              number: 4000
        path: /devlake(/?|$)(.*)
        pathType: Prefix

If we use prefix as / it works just fine but we are not hosting anything at the root of the url. I think this is because of the base_href path is not mentioned in index.html.

Having an option to overwrite the base_path would be ideal in this case where one can put any custom path based on their environments.

主要语言
Go Template
星标
53
派生
71
平均合并
16 小时 15 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/devlake-helm-chart 的其他 Issue

查看 apache/devlake-helm-chart 的全部 Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。