173 lines
6.4 KiB
YAML
173 lines
6.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "jellyfin.fullname" . }}
|
|
labels:
|
|
app.kubernetes.io/name: {{ include "jellyfin.name" . }}
|
|
helm.sh/chart: {{ include "jellyfin.chart" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
spec:
|
|
strategy:
|
|
type: Recreate
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: {{ include "jellyfin.name" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: {{ include "jellyfin.name" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
{{- with .Values.extraPodLabels }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.extraPodAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if .Values.enableDLNA }}
|
|
hostNetwork: true
|
|
{{- end }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
{{ if .Values.image.command }}
|
|
command:
|
|
{{- toYaml .Values.image.command | nindent 12 }}
|
|
{{- end }}
|
|
{{ if .Values.image.args }}
|
|
args:
|
|
{{- toYaml .Values.image.args | nindent 12 }}
|
|
{{- end }}
|
|
{{ if .Values.extraEnvVars }}
|
|
env:
|
|
{{- toYaml .Values.extraEnvVars | nindent 12 }}
|
|
{{- end }}
|
|
{{ if .Values.securityContext }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 8096
|
|
protocol: TCP
|
|
{{ if .Values.enableDLNA }}
|
|
- name: dlna
|
|
containerPort: 1900
|
|
hostPort: 1900
|
|
protocol: UDP
|
|
{{- end }}
|
|
{{ if .Values.livenessProbe.enabled }}
|
|
livenessProbe:
|
|
{{ if .Values.livenessProbe.initialDelaySeconds }}
|
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
|
{{- end }}
|
|
{{ if .Values.livenessProbe.periodSeconds }}
|
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
|
{{- end }}
|
|
{{ if .Values.livenessProbe.timeoutSeconds }}
|
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
|
{{- end }}
|
|
{{ if .Values.livenessProbe.failureThreshold }}
|
|
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
|
{{- end }}
|
|
{{ if .Values.livenessProbe.successThreshold }}
|
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
|
{{- end }}
|
|
tcpSocket:
|
|
port: http
|
|
{{- end }}
|
|
{{ if .Values.readinessProbe.enabled }}
|
|
readinessProbe:
|
|
{{ if .Values.readinessProbe.initialDelaySeconds }}
|
|
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
|
{{- end }}
|
|
{{ if .Values.readinessProbe.periodSeconds }}
|
|
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
|
{{- end }}
|
|
{{ if .Values.readinessProbe.timeoutSeconds }}
|
|
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
|
{{- end }}
|
|
{{ if .Values.readinessProbe.failureThreshold }}
|
|
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
|
{{- end }}
|
|
{{ if .Values.readinessProbe.successThreshold }}
|
|
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
|
{{- end }}
|
|
tcpSocket:
|
|
port: http
|
|
{{- end }}
|
|
volumeMounts:
|
|
- mountPath: /config
|
|
name: config
|
|
{{- if .Values.persistence.config.subPath }}
|
|
subPath: {{ .Values.persistence.config.subPath }}
|
|
{{- end }}
|
|
- mountPath: /media
|
|
name: media
|
|
{{- if .Values.persistence.media.subPath }}
|
|
subPath: {{ .Values.persistence.media.subPath }}
|
|
{{- end }}
|
|
{{- range .Values.persistence.extraExistingClaimMounts }}
|
|
- name: {{ .name }}
|
|
mountPath: {{ .mountPath }}
|
|
readOnly: {{ .readOnly }}
|
|
{{- end }}
|
|
{{- if .Values.extraVolumeMounts }}
|
|
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.extraContainers }}
|
|
{{- toYaml .Values.extraContainers | nindent 8 }}
|
|
{{- end }}
|
|
resources:
|
|
{{ toYaml .Values.resources | indent 12 }}
|
|
terminationMessagePolicy: FallbackToLogsOnError
|
|
securityContext: {{- toYaml .Values.securityContext | nindent 12 }}
|
|
{{- if .Values.extraInitContainers }}
|
|
initContainers:
|
|
{{- toYaml .Values.extraInitContainers | nindent 10 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: config
|
|
{{- if .Values.persistence.config.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ if .Values.persistence.config.existingClaim }}{{ .Values.persistence.config.existingClaim }}{{- else }}{{ template "jellyfin.fullname" . }}-config{{- end }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
- name: media
|
|
{{- if .Values.persistence.media.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ if .Values.persistence.media.existingClaim }}{{ .Values.persistence.media.existingClaim }}{{- else }}{{ template "jellyfin.fullname" . }}-media{{- end }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- range .Values.persistence.extraExistingClaimMounts }}
|
|
- name: {{ .name }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ .existingClaim }}
|
|
{{- end }}
|
|
{{- if .Values.extraVolumes }}
|
|
{{- toYaml .Values.extraVolumes | nindent 6 }}
|
|
{{- end }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector:
|
|
{{ toYaml . | indent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{ toYaml . | indent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations:
|
|
{{ toYaml . | indent 8 }}
|
|
{{- end }}
|
|
securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
{{- if .Values.runtimeClassName }}
|
|
runtimeClassName: {{.Values.runtimeClassName}}
|
|
{{- end }}
|