- multi-stage Dockerfile with ffmpeg on Alpine JRE 21 - Helm chart for k3s: library ConfigMap, Vault users secret, data PVC, read-only hostPath media, ingress, probes and security context - Gitea Actions runs tests, smoke test and chart lint, then builds and pushes the image on main and version tags
119 lines
3.7 KiB
YAML
119 lines
3.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "musicmanager.fullname" . }}
|
|
labels:
|
|
{{- include "musicmanager.labels" . | nindent 4 }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
{{- include "musicmanager.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "musicmanager.selectorLabels" . | nindent 8 }}
|
|
annotations:
|
|
checksum/library: {{ include (print $.Template.BasePath "/configmap-library.yaml") . | sha256sum }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: musicmanager
|
|
image: "{{ include "musicmanager.image" . }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
env:
|
|
- name: PORT
|
|
value: "8080"
|
|
- name: DATA_DIR
|
|
value: /data
|
|
- name: LIBRARY_CONFIG
|
|
value: /etc/musicmanager/library.yaml
|
|
- name: USERS_FILE
|
|
value: /etc/musicmanager/users.yaml
|
|
- name: FFMPEG_PATH
|
|
value: ffmpeg
|
|
{{- with .Values.env }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 8080
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: http
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 20
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: http
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: library
|
|
mountPath: /etc/musicmanager/library.yaml
|
|
subPath: library.yaml
|
|
readOnly: true
|
|
- name: users
|
|
mountPath: /etc/musicmanager/users.yaml
|
|
subPath: {{ .Values.users.key }}
|
|
readOnly: true
|
|
- name: data
|
|
mountPath: /data
|
|
- name: tmp
|
|
mountPath: /tmp
|
|
- name: music
|
|
mountPath: {{ .Values.media.music.mountPath }}
|
|
readOnly: true
|
|
- name: longform
|
|
mountPath: {{ .Values.media.longform.mountPath }}
|
|
readOnly: true
|
|
volumes:
|
|
- name: library
|
|
configMap:
|
|
name: {{ include "musicmanager.fullname" . }}-library
|
|
- name: users
|
|
secret:
|
|
secretName: {{ required "users.existingSecret is required" .Values.users.existingSecret }}
|
|
- name: data
|
|
{{- if .Values.data.persistence.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "musicmanager.fullname" . }}-data
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
- name: tmp
|
|
emptyDir: {}
|
|
- name: music
|
|
hostPath:
|
|
path: {{ .Values.media.music.hostPath }}
|
|
type: Directory
|
|
- name: longform
|
|
hostPath:
|
|
path: {{ .Values.media.longform.hostPath }}
|
|
type: Directory
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|