helm-chart/templates/api.yaml

75 lines
1.8 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
persistence:
config:
enabled: true
type: configMap
name: "{{ .Release.Name }}-api-config"
mountPath: /etc/vikunja/config.yml
subPath: config.yml
probes:
liveness: &probes
enabled: true
custom: true
spec:
httpGet:
path: /api/v1/info
port: http
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
readiness: *probes
startup:
enabled: false
{{ if .Values.frontend.ingress.enabled }}
configMaps:
# The configuration for Vikunja's backend.
# https://vikunja.io/docs/config-options/
config:
enabled: true
data:
config.yml:
service:
# Vikunja needs to know the frontend URL for password reset emails.
frontendUrl: "http://{{ index .Values.frontend.ingress.main.hosts 0 "host" }}{{ index .Values.frontend.ingress.main.hosts 0 "path" }}"
{{ end }}
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.frontend.ingress.enabled }}
VIKUNJA_FRONTEND_URL: "http://{{ index .Values.frontend.ingress.main.hosts 0 "host" }}{{ index .Values.frontend.ingress.main.hosts 0 "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 }}