go-mad/helm/go-mad/templates/deployment.yaml
2026-10-07 15:17:40 +02:00

53 lines
No EOL
1.8 KiB
YAML

{{- $fullName := include "go-mad.fullname" . }}
{{- $values := index .Values "go-mad" }}
{{- $pgName := printf "%s-postgresql" .Release.Name }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "go-mad.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: "{{ .Chart.appVersion }}"
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "go-mad.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "go-mad.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: {{ $fullName }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ $values.serverPort | int }}
env:
- name: GO_MAD_DATABASE_URL
value: "postgres://mad:{{ .Values.postgresql.auth.password }}@{{ $pgName }}:5432/mad?sslmode=disable"
- name: GO_MAD_SERVER_PORT
value: "{{ $values.serverPort }}"
- name: GO_MAD_JWT_SECRET
value: "{{ $values.jwtSecret }}"
{{- with $values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
httpGet:
path: /health
port: {{ $values.serverPort | int }}
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /health
port: {{ $values.serverPort | int }}
initialDelaySeconds: 10
periodSeconds: 15