Files
charts/test/plex/1.0.1/templates/deployment.yaml
T

105 lines
4.5 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "common.names.fullname" . }}
labels: {{ include "common.labels" . | nindent 4 }}
spec:
replicas: 1
revisionHistoryLimit: 3
strategy:
type: {{ .Values.strategyType }}
selector:
matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
template:
metadata:
labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
annotations: {{ include "common.annotations" . | nindent 8 }}
spec:
{{- if .Values.hostNetwork }}
hostNetwork: {{ .Values.hostNetwork }}
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
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: KUBE_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{ $envList := (default list .Values.environmentVariables) }}
{{ $envList = mustAppend $envList (dict "name" "TZ" "value" .Values.timezone) }}
{{ $envList = mustAppend $envList (dict "name" "PLEX_CLAIM" "value" .Values.claimToken) }}
{{ $envList = mustAppend $envList (dict "name" "PMS_INTERNAL_ADDRESS" "value" (printf "http://%s:32400" (include "common.names.fullname" .))) }}
{{ $envList = mustAppend $envList (dict "name" "PMS_IMAGE" "value" (printf "%s:%s" .Values.image.repository .Values.image.tag))}}
{{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
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:
{{ $emptyDir := .Values.emptyDirVolumes }}
{{ $vols := list }}
{{ $vols = mustAppend $vols (dict "name" "data" "emptyDirVolumes" $emptyDir "hostPathEnabled" .Values.dataHostPathEnabled "pathField" .Values.dataHostPath "datasetName" (.Values.dataVolume | default dict).datasetName ) }}
{{ $vols = mustAppend $vols (dict "name" "config" "emptyDirVolumes" $emptyDir "hostPathEnabled" .Values.configHostPathEnabled "pathField" .Values.configHostPath "datasetName" (.Values.configVolume | default dict).datasetName ) }}
{{ $vols = mustAppend $vols (dict "name" "transcode" "emptyDirVolumes" $emptyDir "hostPathEnabled" .Values.transcodeHostPathEnabled "pathField" .Values.transcodeHostPath "datasetName" (.Values.transcodeVolume | default dict).datasetName ) }}
{{ $vols = mustAppend $vols (dict "name" "shared" "emptyDirVolumes" true "hostPathEnabled" false "pathField" nil "datasetName" nil) }}
{{ $vols = mustAppend $vols (dict "name" "shared-logs" "emptyDirVolumes" true "hostPathEnabled" false "pathField" nil "datasetName" nil) }}
{{ include "common.storage.volumesConfiguration" (dict "ixVolumes" .Values.ixVolumes "volumes" $vols) | nindent 8 }}