Skip to content

Commit 6cb0a2f

Browse files
committed
fix: use public ingress URL for frontend API requests (fixes #3)
The PUBLIC_API_URL was hardcoded to use internal k8s service DNS (http://logtide-backend:8080) which cannot be resolved by browsers outside the cluster. Now the chart automatically derives the API URL from the ingress configuration when enabled. Users can also explicitly set frontend.publicApiUrl if needed.
1 parent 09d328a commit 6cb0a2f

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

charts/logtide/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: logtide
33
description: A Helm chart for LogTide - Open-source log management and SIEM platform
44
type: application
5-
version: 2.0.4
5+
version: 2.0.5
66
appVersion: "0.4.0"
77

88
home: https://logtide.dev

charts/logtide/templates/frontend-deployment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ spec:
4545
- name: NODE_ENV
4646
value: {{ .Values.config.nodeEnv | quote }}
4747
- name: PUBLIC_API_URL
48+
{{- if .Values.frontend.publicApiUrl }}
49+
value: {{ .Values.frontend.publicApiUrl | quote }}
50+
{{- else if .Values.ingress.enabled }}
51+
{{- $scheme := "https" }}
52+
{{- if not .Values.ingress.tls }}
53+
{{- $scheme = "http" }}
54+
{{- end }}
55+
value: "{{ $scheme }}://{{ (index .Values.ingress.hosts 0).host }}/api"
56+
{{- else }}
4857
value: "http://{{ include "logtide.fullname" . }}-backend:{{ .Values.backend.service.port }}"
58+
{{- end }}
4959
- name: ORIGIN
5060
{{- if .Values.ingress.enabled }}
5161
value: "https://{{ (index .Values.ingress.hosts 0).host }}"

charts/logtide/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ frontend:
8080
tag: "" # Defaults to appVersion
8181
pullPolicy: IfNotPresent
8282

83+
# Public API URL for browser requests
84+
# This URL must be accessible from the user's browser (not internal k8s DNS)
85+
# If empty and ingress is enabled, defaults to https://{ingress-host}/api
86+
# Examples:
87+
# - "https://logtide.example.com/api" (with ingress)
88+
# - "http://localhost:8080" (local development with port-forward)
89+
publicApiUrl: ""
90+
8391
service:
8492
type: ClusterIP
8593
port: 3000

0 commit comments

Comments
 (0)