MetaTrader5-Docker-Goldex/charts/mt5/templates/deployment.yaml
2026-11-06 14:22:28 +01:00

94 lines
2.8 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mt5.fullname" . }}
labels:
{{- include "mt5.labels" . | nindent 4 }}
spec:
replicas: 1
# RWO-Volume + Wine-Prefix: nie zwei Pods gleichzeitig
strategy:
type: Recreate
selector:
matchLabels:
{{- include "mt5.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "mt5.selectorLabels" . | nindent 8 }}
annotations:
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
spec:
# Pod ist lange beschäftigt beim Herunterfahren von Wine
terminationGracePeriodSeconds: 60
containers:
- name: mt5
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- secretRef:
name: {{ include "mt5.secretName" . }}
env:
- name: TZ
value: {{ .Values.tz | quote }}
- name: PUID
value: {{ .Values.puid | quote }}
- name: PGID
value: {{ .Values.pgid | quote }}
{{- if .Values.mt5CmdOptions }}
- name: MT5_CMD_OPTIONS
value: {{ .Values.mt5CmdOptions | quote }}
{{- end }}
ports:
- name: web
containerPort: 3000
protocol: TCP
- name: rpyc
containerPort: 8001
protocol: TCP
# Erststart installiert Wine/MT5 (~5 Min) – bis 15 Min Zeit geben
startupProbe:
tcpSocket:
port: web
periodSeconds: 10
failureThreshold: 90
readinessProbe:
tcpSocket:
port: web
periodSeconds: 15
livenessProbe:
tcpSocket:
port: web
periodSeconds: 30
failureThreshold: 5
volumeMounts:
- name: config
mountPath: /config
- name: dshm
mountPath: /dev/shm
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: config
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ include "mt5.claimName" . }}
{{- else }}
emptyDir: {}
{{- end }}
- name: dshm
emptyDir:
medium: Memory
sizeLimit: {{ .Values.shmSize }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}