mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 07:30:04 +00:00
8e2840b29d
A probe map is exactly the value someone reaches for when their cluster is unhappy, so the two ways of reaching for it should not break the render. `probes: null` hit a nil pointer on `.Values.probes.liveness`; guarding with `with (default dict ...)` also makes dropping a single probe work, which is what you want on a pod whose liveness check is the thing killing it. The rest is documentation the chart already gives every other value: a wiki section next to Resource Limits, a Notes bullet, and a values comment naming the one trap here, that a handler switch has to clear the shipped httpGet in the same override or the API refuses the pod. Verified with helm template: defaults render byte for byte what the chart produced before, probes=null renders no probes, probes.liveness=null leaves one, and helm lint passes.
106 lines
4.0 KiB
YAML
106 lines
4.0 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. Override to RollingUpdate only with a ReadWriteMany volume.
|
|
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:
|
|
- containerPort: 3000
|
|
envFrom:
|
|
- configMapRef:
|
|
name: {{ include "trek.fullname" . }}-config
|
|
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
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /app/data
|
|
- name: uploads
|
|
mountPath: /app/uploads
|
|
{{- 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 }}
|