{{- if not (has .Values.defaultSource (list "deezer" "youtube")) }} {{- fail "defaultSource must be deezer or youtube" }} {{- end }} {{- if not (has (int .Values.deezer.quality) (list 0 1)) }} {{- fail "deezer.quality must be 0 (128 kbps) or 1 (320 kbps)" }} {{- end }} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "audiomanager.fullname" . }} namespace: {{ include "audiomanager.namespace" . }} labels: {{- include "audiomanager.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} strategy: type: Recreate selector: matchLabels: {{- include "audiomanager.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "audiomanager.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: audiomanager image: "{{ include "audiomanager.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} env: - name: PORT value: "8080" - name: DATA_DIR value: /data - name: MEDIA_DIR value: /data/media - name: DOWNLOAD_DIR value: /data/downloads - name: USERS_FILE value: /etc/audiomanager/users.yaml - name: FFMPEG_PATH value: ffmpeg - name: YTDLP_PATH value: yt-dlp - name: STREAMRIP_PATH value: rip - name: DEFAULT_SOURCE value: {{ .Values.defaultSource | quote }} - name: DEEZER_QUALITY value: {{ .Values.deezer.quality | quote }} - name: DEEZER_API_BASE value: {{ .Values.deezer.apiBase | quote }} {{- if .Values.deezer.existingSecret }} - name: DEEZER_ARL valueFrom: secretKeyRef: name: {{ .Values.deezer.existingSecret }} key: {{ .Values.deezer.key }} optional: true {{- end }} {{- 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: users mountPath: /etc/audiomanager/users.yaml subPath: {{ .Values.users.key }} readOnly: true - name: data mountPath: /data - name: tmp mountPath: /tmp volumes: - name: users secret: secretName: {{ required "users.existingSecret is required" .Values.users.existingSecret }} - name: data {{- if .Values.data.persistence.enabled }} persistentVolumeClaim: claimName: {{ include "audiomanager.fullname" . }}-data {{- else }} emptyDir: {} {{- end }} - name: tmp emptyDir: {} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}