Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingress如不是标准端口,会导致Dify访问不了 #74

Closed
jeessy2 opened this issue Apr 18, 2024 · 6 comments · Fixed by #75
Closed

Ingress如不是标准端口,会导致Dify访问不了 #74

jeessy2 opened this issue Apr 18, 2024 · 6 comments · Fixed by #75

Comments

@jeessy2
Copy link
Contributor

jeessy2 commented Apr 18, 2024

因为生成的不含端口,如果Ingress访问端口不是443的话,会访问不了。自定义环境变量也不行,会有两个相同的变量名。

{{- range tuple "CONSOLE_API_URL" "CONSOLE_WEB_URL" "SERVICE_API_URL" "APP_API_URL" "APP_WEB_URL" }}

@LeoQuote
Copy link
Contributor

我这边没这种环境, 你有什么建议的方案?

@LeoQuote
Copy link
Contributor

{{- define "dify.baseUrl" -}}
{{ if .Values.global.enableTLS }}https://{{ else }}http://{{ end }}{{.Values.global.host}}
{{- end }}
这里加一些比如 external port 的 value 如何? 你如果想的话可以直接 pr

@jeessy2
Copy link
Contributor Author

jeessy2 commented Apr 18, 2024

这样?
如果你在 values.yaml 文件中定义了多个相同名称的环境变量,你可以使用 Helm 的 dict 函数将它们合并为一个单独的 env 列表。

# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}
spec:
  template:
    spec:
      containers:
      - name: {{ .Release.Name }}
        env:
        {{- $envs := dict }}
        {{- range $index, $env := .Values.env }}
        {{- $_ := set $envs $env.name $env }}
        {{- end }}
        {{- range $key, $value := $envs }}
        - name: {{ $key }}
          value: {{ $value.value }}
        {{- end }}

@LeoQuote
Copy link
Contributor

我觉得有点复杂, 我上面提的方案如何呢? 就是加一个 global.port 的value, 如果有就在里面渲染就行

@jeessy2
Copy link
Contributor Author

jeessy2 commented Apr 18, 2024

也可以

@LeoQuote
Copy link
Contributor

提个 pr 吧, 谢谢~ 你顺便也可以验证下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants