helm-charts/mollysocket/templates/deployment.yaml
2025-03-17 19:30:27 +01:00

99 lines
3.2 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mollysocket.fullname" . }}
labels:
{{- include "mollysocket.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "mollysocket.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
configmap-hash: {{ .Values.mollysocket | toYaml | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "mollysocket.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "mollysocket.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- with .Values.image }}
image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }}
{{- end }}
args:
- "server"
ports:
- name: http
containerPort: 8020
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: "RUST_LOG"
value: "{{ .Values.mollysocket.log }}"
- name: "ROCKET_ADDRESS"
value: "0.0.0.0"
- name: "ROCKET_PROMETHEUS_NAMESPACE"
value: "mollysocket"
- name: "MOLLY_VAPID_KEY_FILE"
value: "/secret/ms_vapid_key"
- name: "MOLLY_CONF"
value: "/config/molly.toml"
volumeMounts:
- mountPath: "/config"
name: "config"
- mountPath: "/secret"
name: "secret"
- mountPath: "/database"
name: "database"
volumes:
- name: "config"
configMap:
name: {{ include "mollysocket.fullname" . }}
- name: "secret"
secret:
secretName: {{ include "mollysocket.fullname" . }}
- name: "database"
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "mollysocket.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}