--- apiVersion: v1 kind: ConfigMap metadata: name: plex-envs data: PUID: "1000" PGID: "1000" TZ: {{ .Values.global.timezone }} ADVERTISE_IP: "https://plex.{{ .Values.global.rootSubDomain }}.{{ .Values.global.domain }}" --- kind: Service apiVersion: v1 metadata: name: plex spec: selector: app: plex type: ClusterIP ports: - port: 32400 targetPort: 32400 name: "32400" - port: 1900 targetPort: 1900 name: "1900-udp" protocol: UDP - port: 3005 targetPort: 3005 name: "3005" - port: 5353 targetPort: 5353 name: "5353-udp" protocol: UDP - port: 8324 targetPort: 8324 name: "8324" - port: 32410 targetPort: 32410 name: "32410-udp" protocol: UDP - port: 32412 targetPort: 32412 name: "32412-udp" protocol: UDP - port: 32413 targetPort: 32413 name: "32413-udp" protocol: UDP - port: 32414 targetPort: 32414 name: "32414-udp" protocol: UDP - port: 32469 targetPort: 32469 name: "32469" --- apiVersion: apps/v1 kind: StatefulSet metadata: name: plex spec: selector: matchLabels: app: plex replicas: 1 revisionHistoryLimit: 2 updateStrategy: type: RollingUpdate volumeClaimTemplates: - metadata: finalizers: - kubernetes.io/pvc-protection name: config spec: storageClassName: local-path accessModes: - ReadWriteOnce resources: requests: storage: 10Gi limits: storage: 100Gi - metadata: name: transcode spec: storageClassName: local-path accessModes: - ReadWriteOnce resources: requests: storage: 10Gi limits: storage: 100Gi template: metadata: labels: app: plex spec: affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 preference: matchExpressions: - key: homelab/capacity operator: In values: - high containers: - name: plex image: "{{ .Values.plex.repo }}:{{ .Values.plex.tag }}" imagePullPolicy: "Always" envFrom: - configMapRef: name: plex-envs ports: - containerPort: 32400 name: plex - containerPort: 1900 protocol: UDP - containerPort: 3005 - containerPort: 5353 protocol: UDP - containerPort: 8324 - containerPort: 32410 protocol: UDP - containerPort: 32412 protocol: UDP - containerPort: 32413 protocol: UDP - containerPort: 32414 protocol: UDP - containerPort: 32469 resources: {{- .Values.plex.resources | toYaml | nindent 12 }} volumeMounts: - name: config mountPath: /config - name: transcode mountPath: /transcode - name: torrents mountPath: /tv subPath: tv - name: torrents mountPath: /movies subPath: movies - name: family-videos mountPath: /family-videos startupProbe: tcpSocket: port: plex initialDelaySeconds: 10 failureThreshold: 10 timeoutSeconds: 30 volumes: - name: torrents nfs: server: "{{ $.Values.global.nfs.server }}" path: "{{ $.Values.global.nfs.additionalShares.torrents }}" readOnly: true - name: family-videos nfs: server: "{{ $.Values.global.nfs.server }}" path: "{{ .Values.global.nfs.additionalShares.familyvideos }}" readOnly: true