| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: {{ include "plex.fullname" . }}
- labels:
- {{- include "plex.labels" . | nindent 4 }}
- spec:
- replicas: 1
- revisionHistoryLimit: 3
- strategy:
- type: {{ .Values.strategyType }}
- selector:
- matchLabels:
- {{- include "plex.selectorLabels" . | nindent 6 }}
- template:
- metadata:
- labels:
- {{- include "plex.selectorLabels" . | nindent 8 }}
- annotations:
- rollme: {{ randAlphaNum 5 | quote }}
- spec:
- {{- if .Values.hostNetwork }}
- hostNetwork: {{ .Values.hostNetwork }}
- dnsPolicy: ClusterFirstWithHostNet
- {{- end }}
- containers:
- - name: {{ .Chart.Name }}
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- ports:
- - name: pms
- protocol: TCP
- containerPort: 32400
- {{- if .Values.hostNetwork }}
- hostPort: {{ .Values.plexServiceTCP.port }}
- {{- end }}
- - name: plex-dlna
- protocol: TCP
- containerPort: 32469
- - name: plex-dlna-udp
- protocol: UDP
- containerPort: 1900
- - name: plex-gdm1
- protocol: UDP
- containerPort: 32410
- - name: plex-gdm2
- protocol: UDP
- containerPort: 32412
- - name: plex-gdm3
- protocol: UDP
- containerPort: 32413
- - name: plex-gdm4
- protocol: UDP
- containerPort: 32414
- env:
- - name: TZ
- value: "{{ .Values.timezone }}"
- # TODO: move this to a secret?
- - name: PLEX_CLAIM
- value: "{{ .Values.claimToken }}"
- # plex env vars
- - name: PMS_INTERNAL_ADDRESS
- value: http://{{ template "plex.fullname" . }}:32400
- - name: PMS_IMAGE
- value: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
- - name: KUBE_NAMESPACE
- valueFrom:
- fieldRef:
- fieldPath: metadata.namespace
- {{- if .Values.proxy.enabled }}
- {{- if .Values.proxy.http }}
- - name: "HTTP_PROXY"
- value: "{{.Values.proxy.http}}"
- {{- end }}
- {{- if .Values.proxy.https }}
- - name: "HTTPS_PROXY"
- value: "{{.Values.proxy.https}}"
- {{- end }}
- {{- end }}
- {{- if .Values.advertiseIp }}
- - name: "ADVERTISE_IP"
- value: "{{.Values.advertiseIp}}"
- {{- end }}
- {{- if .Values.allowedNetworks }}
- - name: "ALLOWED_NETWORKS"
- value: "{{include "joinListWithComma" .Values.allowedNetworks}}"
- {{- end }}
- # Extra ENV Values supplied by user
- {{- range $key, $value := .Values.extraEnv }}
- - name: {{ $key }}
- value: {{ $value }}
- {{- end }}
- readinessProbe:
- httpGet:
- path: /identity
- port: 32400
- failureThreshold: 5
- periodSeconds: 15
- livenessProbe:
- httpGet:
- path: /identity
- port: 32400
- failureThreshold: 5
- periodSeconds: 15
- startupProbe:
- httpGet:
- path: /identity
- port: 32400
- initialDelaySeconds: 5
- failureThreshold: 40
- periodSeconds: 15
- volumeMounts:
- - name: data
- mountPath: /data
- - name: config
- mountPath: /config
- - name: transcode
- mountPath: /transcode
- - name: shared
- mountPath: /shared
- - name: shared-logs
- mountPath: "/config/Library/Application Support/Plex Media Server/Logs"
- {{- if .Values.gpuConfiguration }}
- resources:
- limits:
- {{- toYaml .Values.gpuConfiguration | nindent 14 }}
- {{- end }}
- volumes:
- - name: data
- {{- if .Values.emptyDirVolumes }}
- emptyDir: {}
- {{- else }}
- hostPath:
- path: {{ template "configuredHostPathData" . }}
- {{- end }}
- - name: config
- {{- if .Values.emptyDirVolumes }}
- emptyDir: {}
- {{- else }}
- hostPath:
- path: {{ template "configuredHostPathConfig" . }}
- {{- end }}
- - name: transcode
- {{- if .Values.emptyDirVolumes }}
- emptyDir: {}
- {{- else }}
- hostPath:
- path: {{ template "configuredHostPathTranscode" . }}
- {{- end }}
- - name: shared
- emptyDir: {}
- - name: shared-logs
- emptyDir: {}
|