diff --git a/charts/spire/charts/tornjak-frontend/README.md b/charts/spire/charts/tornjak-frontend/README.md index e8df4a2..38239d4 100644 --- a/charts/spire/charts/tornjak-frontend/README.md +++ b/charts/spire/charts/tornjak-frontend/README.md @@ -81,7 +81,7 @@ port forwarding. See the chart NOTES output for more details. | `affinity` | Affinity rules | `{}` | | `tolerations` | List of tolerations | `[]` | | `topologySpreadConstraints` | List of topology spread constraints for resilience | `[]` | -| `apiServerURL` | URL of the Tornjak APIs (backend). Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser. | `http://localhost:10000/` | +| `apiServerURL` | URL of the Tornjak APIs (backend). Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser. If unset, autodetection is atempted. | `""` | | `spireHealthCheck.enabled` | Enables the SPIRE Healthchecker indicator | `true` | | `startupProbe.enabled` | Enable startupProbe on Tornjak frontend container | `true` | | `startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `5` | diff --git a/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl b/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl index 0dadaeb..fd7a92b 100644 --- a/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl +++ b/charts/spire/charts/tornjak-frontend/templates/_helpers.tpl @@ -78,8 +78,9 @@ Create URL for accessing Tornjak APIs {{- define "tornjak-frontend.apiURL" -}} {{- if .Values.apiServerURL -}} {{- .Values.apiServerURL -}} +{{- else if .Values.ingress.enabled }} +{{- printf "https://tornjak-backend.%s" (include "spire-lib.trust-domain" .) }} {{- else }} -{{- $feurl := print "http://localhost:" .Values.service.port }} -{{- $feurl }} +{{- print "http://localhost:" .Values.service.port }} {{- end }} {{- end }} diff --git a/charts/spire/charts/tornjak-frontend/values.yaml b/charts/spire/charts/tornjak-frontend/values.yaml index 34ddb7e..7917df4 100644 --- a/charts/spire/charts/tornjak-frontend/values.yaml +++ b/charts/spire/charts/tornjak-frontend/values.yaml @@ -88,8 +88,8 @@ topologySpreadConstraints: [] # cpu: 100m # memory: 512Mi -## @param apiServerURL URL of the Tornjak APIs (backend). Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser. -apiServerURL: "http://localhost:10000/" # 👈 Use it for minikube or kind +## @param apiServerURL URL of the Tornjak APIs (backend). Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser. If unset, autodetection is atempted. +apiServerURL: "" # SPIRE Healthchecker indicator spireHealthCheck: diff --git a/examples/production/example-your-values.yaml b/examples/production/example-your-values.yaml index ee92f79..7c3a830 100644 --- a/examples/production/example-your-values.yaml +++ b/examples/production/example-your-values.yaml @@ -20,7 +20,3 @@ spire-server: # ingress: # host: oidc-discovery # tlsSecret: tls-cert - -tornjak-frontend: - apiServerURL: https://tornjak-backend.production.other/ - diff --git a/examples/tornjak/values.yaml b/examples/tornjak/values.yaml index a407265..6ba0015 100644 --- a/examples/tornjak/values.yaml +++ b/examples/tornjak/values.yaml @@ -7,7 +7,6 @@ tornjak-frontend: service: type: ClusterIP port: 3000 - apiServerURL: "http://localhost:10000/" resources: requests: cpu: 50m