mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-26 22:57:32 +00:00
afacf00c9f
docker-compose.yml and the Helm chart name the switch and the key (the key in the Secret, never the ConfigMap), and the wiki explains the installation key, what it carries, where it goes and the admin view of the allowance.
171 lines
6.8 KiB
YAML
171 lines
6.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "trek.fullname" . }}
|
|
labels:
|
|
app: {{ include "trek.name" . }}
|
|
spec:
|
|
replicas: 1
|
|
# TREK is a single-writer SQLite app on a ReadWriteOnce PVC, so the default
|
|
# RollingUpdate would start a second pod holding the same volume before the old one
|
|
# exits — a Multi-Attach deadlock, or two processes on one travel.db. Recreate tears
|
|
# the old pod down first. Keep it, see updateStrategy in values.yaml.
|
|
strategy:
|
|
type: {{ .Values.updateStrategy | default "Recreate" }}
|
|
selector:
|
|
matchLabels:
|
|
app: {{ include "trek.name" . }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
|
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
|
labels:
|
|
app: {{ include "trek.name" . }}
|
|
spec:
|
|
{{- if .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- range .Values.imagePullSecrets }}
|
|
- name: {{ .name }}
|
|
{{- end }}
|
|
{{- end }}
|
|
securityContext:
|
|
fsGroup: 1000
|
|
containers:
|
|
- name: trek
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
{{- with .Values.resources }}
|
|
resources:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.env.PORT | default 3000 }}
|
|
envFrom:
|
|
- configMapRef:
|
|
name: {{ include "trek.fullname" . }}-config
|
|
{{- with .Values.extraEnvFrom }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
env:
|
|
- name: ENCRYPTION_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: {{ .Values.existingSecretKey | default "ENCRYPTION_KEY" }}
|
|
optional: true
|
|
- name: ADMIN_EMAIL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: ADMIN_EMAIL
|
|
optional: true
|
|
- name: ADMIN_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: ADMIN_PASSWORD
|
|
optional: true
|
|
- name: OIDC_CLIENT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: OIDC_CLIENT_SECRET
|
|
optional: true
|
|
- name: UNSPLASH_ACCESS_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: UNSPLASH_ACCESS_KEY
|
|
optional: true
|
|
- name: PLACES_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: PLACES_API_KEY
|
|
optional: true
|
|
- name: TREK_SERVICES_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: TREK_SERVICES_KEY
|
|
optional: true
|
|
- name: AMAP_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: AMAP_API_KEY
|
|
optional: true
|
|
- name: AMAP_API_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: AMAP_API_SECRET
|
|
optional: true
|
|
- name: VAPID_PRIVATE_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: VAPID_PRIVATE_KEY
|
|
optional: true
|
|
- name: SMTP_PASS
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: SMTP_PASS
|
|
optional: true
|
|
- name: MAPBOX_ACCESS_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: MAPBOX_ACCESS_TOKEN
|
|
optional: true
|
|
- name: CARTO_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: CARTO_API_KEY
|
|
optional: true
|
|
- name: DEMO_ADMIN_PASS
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ default (printf "%s-secret" (include "trek.fullname" .)) .Values.existingSecret }}
|
|
key: DEMO_ADMIN_PASS
|
|
optional: true
|
|
{{- with .Values.extraEnv }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /app/data
|
|
- name: uploads
|
|
mountPath: /app/uploads
|
|
{{- with (default dict .Values.probes).startup }}
|
|
startupProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with (default dict .Values.probes).liveness }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with (default dict .Values.probes).readiness }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: data
|
|
{{- if .Values.persistence.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ default (printf "%s-data" (include "trek.fullname" .)) .Values.persistence.data.existingClaim }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
- name: uploads
|
|
{{- if .Values.persistence.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ default (printf "%s-uploads" (include "trek.fullname" .)) .Values.persistence.uploads.existingClaim }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|