mirror of
https://github.com/truenas/charts.git
synced 2026-11-12 22:43:24 +00:00
154 lines
4.5 KiB
YAML
154 lines
4.5 KiB
YAML
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: {}
|