helm-chart/templates/backend.yaml
perf3ct 5312dc6a34
Some checks failed
continuous-integration/drone/pr Build is failing
change backend to be api
2023-10-04 10:02:37 -07:00

43 lines
1.1 KiB
YAML

{{- define "vikunja.api.hardcodedValues" -}}
global:
nameOverride: api
service:
main:
enabled: true
primary: true
type: ClusterIP
ports:
http:
enabled: true
primary: true
port: 3456
protocol: HTTP
env:
{{ if .Values.redis.enabled }}
VIKUNJA_REDIS_ENABLED: "true"
{{ end }}
{{ if .Values.typesense.enabled }}
VIKUNJA_TYPESENSE_ENABLED: "true"
{{ end }}
# Logic to decide what the api URL should be
{{ if .Values.ingress.enabled }}
VIKUNJA_API_URL: "https://{{ .Values.ingress.host }}{{ .Values.ingress.path }}"
{{ else if .Values.service.main.enabled }}
VIKUNJA_API_URL: "http://{{ .Values.service.main.name }}.{{ .Values.service.main.namespace }}.svc.cluster.local:{{ .Values.service.main.ports.http.port }}{{ .Values.ingress.path }}"
{{ else }}
VIKUNJA_API_URL: "http://localhost:3456{{ .Values.ingress.path }}"
{{ end }}
{{ end }}
{{ if .Values.api.enabled }}
{{- $ctx := deepCopy . -}}
{{- $_ := get .Values "api" | mergeOverwrite $ctx.Values -}}
{{- $_ = include "vikunja.api.hardcodedValues" . | fromYaml | merge $ctx.Values -}}
{{- include "bjw-s.common.loader.all" $ctx }}
{{ end }}