142 lines
4.3 KiB
YAML
142 lines
4.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "jellyfin.fullname" . }}
|
|
labels:
|
|
{{- include "jellyfin.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.enabled }}
|
|
replicas: {{ .Values.replicaCount }}
|
|
{{- end }}
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
{{- include "jellyfin.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "jellyfin.selectorLabels" . | nindent 8 }}
|
|
{{- with .Values.podLabels }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "jellyfin.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
{{- if .Values.config.enabled }}
|
|
initContainers:
|
|
- name: patch-config
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
{{- with .Values.config.image }}
|
|
image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag }}"
|
|
imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }}
|
|
{{- end }}
|
|
command:
|
|
- "/bin/sh"
|
|
- "/scripts/init.sh"
|
|
volumeMounts:
|
|
- mountPath: /config
|
|
name: config
|
|
- mountPath: /scripts
|
|
name: configmap
|
|
{{- end }}
|
|
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 }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.service.port }}
|
|
protocol: TCP
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: http
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: http
|
|
startupProbe:
|
|
httpGet:
|
|
path: /
|
|
port: http
|
|
failureThreshold: 60
|
|
periodSeconds: 10
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- mountPath: /config
|
|
name: config
|
|
- mountPath: /cache
|
|
name: cache
|
|
- mountPath: /media
|
|
name: media
|
|
readOnly: {{ .Values.persistence.media.readOnly }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: config
|
|
{{- with .Values.persistence.config }}
|
|
{{- if .nfs.server }}
|
|
nfs:
|
|
{{- toYaml .nfs | nindent 12 }}
|
|
{{- else if .hostPath }}
|
|
hostPath:
|
|
path: {{ .hostPath }}
|
|
{{- else if .pvc.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ .pvc.claimName }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- end }}
|
|
- name: cache
|
|
emptyDir: {}
|
|
{{- if .Values.config.enabled }}
|
|
- name: configmap
|
|
configMap:
|
|
name: {{ include "jellyfin.fullname" . }}-config
|
|
defaultMode: 0755
|
|
items:
|
|
- key: "patch.sh"
|
|
path: "init.sh"
|
|
{{- end }}
|
|
- name: media
|
|
{{- with .Values.persistence.media }}
|
|
{{- if .nfs.server }}
|
|
nfs:
|
|
{{- toYaml .nfs | nindent 12 }}
|
|
{{- else if .hostPath }}
|
|
hostPath:
|
|
path: {{ .hostPath }}
|
|
{{- else if .pvc.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ .pvc.claimName }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- end }}
|