Files
Termix/charts/termix/templates/deployment.yaml
T

149 lines
5.3 KiB
YAML
Raw Normal View History

2026-08-22 19:47:40 -05:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "termix.fullname" . }}
labels:
{{- include "termix.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
strategy:
{{- toYaml .Values.strategy | nindent 4 }}
selector:
matchLabels:
{{- include "termix.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "termix.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "termix.serviceAccountName" . }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: termix
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
env:
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.guacd.enabled }}
- name: GUACD_HOST
value: "127.0.0.1"
{{- else if .Values.guacd.host }}
- name: GUACD_HOST
value: {{ .Values.guacd.host | quote }}
{{- end }}
- name: GUACD_TUNNEL_HOST
value: {{ include "termix.fullname" . | quote }}
{{- if ne .Values.database.dialect "sqlite" }}
- name: DATABASE_DIALECT
value: {{ .Values.database.dialect | quote }}
{{- end }}
{{- if .Values.database.existingSecret.name }}
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ .Values.database.existingSecret.name }}
key: {{ .Values.database.existingSecret.urlKey }}
{{- end }}
{{- if .Values.secrets.create }}
{{- range $key, $value := .Values.secrets.data }}
{{- if $value }}
- name: {{ $key }}
valueFrom:
secretKeyRef:
name: {{ include "termix.secretName" $ }}
key: {{ $key }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.probes.liveness.enabled }}
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
{{- end }}
{{- if .Values.probes.readiness.enabled }}
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: data
mountPath: /app/data
{{- if .Values.guacd.enabled }}
- name: guacd
image: "{{ .Values.guacd.image.repository }}:{{ .Values.guacd.image.tag }}"
imagePullPolicy: {{ .Values.guacd.image.pullPolicy }}
securityContext:
{{- toYaml .Values.guacd.securityContext | nindent 12 }}
ports:
- name: guacd
containerPort: {{ .Values.guacd.service.port }}
protocol: TCP
resources:
{{- toYaml .Values.guacd.resources | nindent 12 }}
volumeMounts:
- name: data
mountPath: /termix-data
{{- end }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ default (printf "%s-data" (include "termix.fullname" .)) .Values.persistence.existingClaim }}
{{- 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 }}