helm-charts/jellyfin/templates/deployment.yaml

108 lines
3.1 KiB
YAML
Raw Normal View History

2023-09-04 03:26:56 +02:00
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
2023-09-04 03:26:56 +02:00
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 }}
2023-09-04 03:26:56 +02:00
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "jellyfin.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
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
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
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: {}
- 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 }}