diff --git a/catalog.json b/catalog.json index cb90578271..a0c40b2e09 100644 --- a/catalog.json +++ b/catalog.json @@ -68,10 +68,10 @@ "healthy": true, "healthy_error": null, "location": "/__w/charts/charts/charts/plex", - "latest_version": "1.7.32", + "latest_version": "1.7.33", "latest_app_version": "1.31.2.6810", - "latest_human_version": "1.31.2.6810_1.7.32", - "last_update": "2023-03-15 12:30:32", + "latest_human_version": "1.31.2.6810_1.7.33", + "last_update": "2023-03-24 21:20:22", "name": "plex", "recommended": false, "title": "Plex", @@ -163,7 +163,7 @@ "latest_version": "1.2.7", "latest_app_version": "21.11.4.1.1", "latest_human_version": "21.11.4.1.1_1.2.7", - "last_update": "2023-03-24 21:18:22", + "last_update": "2023-03-24 21:19:04", "name": "collabora", "recommended": false, "title": "Collabora", diff --git a/charts/plex/1.7.33/.helmignore b/charts/plex/1.7.33/.helmignore new file mode 100644 index 0000000000..e559de0a01 --- /dev/null +++ b/charts/plex/1.7.33/.helmignore @@ -0,0 +1,24 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +# OWNERS file for Kubernetes +OWNERS diff --git a/charts/plex/1.7.33/Chart.lock b/charts/plex/1.7.33/Chart.lock new file mode 100644 index 0000000000..ec220cc934 --- /dev/null +++ b/charts/plex/1.7.33/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../common/2207.0.0 + version: 2207.0.0 +digest: sha256:a301ba0f99ec1e08a60a7f0a0320aa02d225993572f2f056f09520f06df88b37 +generated: "2023-03-21T16:48:15.265115312+02:00" diff --git a/charts/plex/1.7.33/Chart.yaml b/charts/plex/1.7.33/Chart.yaml new file mode 100644 index 0000000000..204d09d8f3 --- /dev/null +++ b/charts/plex/1.7.33/Chart.yaml @@ -0,0 +1,23 @@ +name: plex +description: Plex Media Server +annotations: + title: Plex +type: application +version: 1.7.33 +apiVersion: v2 +appVersion: '1.31.2.6810' +kubeVersion: '>=1.16.0-0' +maintainers: + - name: truenas + url: https://www.truenas.com/ +dependencies: + - name: common + repository: file://../../../common/2207.0.0 + version: 2207.0.0 +home: https://plex.tv/ +icon: https://www.plex.tv/wp-content/uploads/2018/01/pmp-icon-1.png +sources: + - https://hub.docker.com/r/plexinc/pms-docker/ + - https://github.com/k8s-at-home/charts/tree/master/charts/plex +keywords: + - plex diff --git a/charts/plex/1.7.33/README.md b/charts/plex/1.7.33/README.md new file mode 100644 index 0000000000..7a3bb510dc --- /dev/null +++ b/charts/plex/1.7.33/README.md @@ -0,0 +1,5 @@ +# Plex Media Server helm chart + +## Configuration + +Please refer to questions.yaml for a detailed overview on supported configurable items. diff --git a/charts/plex/1.7.33/app-readme.md b/charts/plex/1.7.33/app-readme.md new file mode 100644 index 0000000000..cb657a2f0e --- /dev/null +++ b/charts/plex/1.7.33/app-readme.md @@ -0,0 +1,3 @@ +# Plex + +Plex chart is a chart designed to deploy plex in a TrueNAS SCALE kubernetes cluster. diff --git a/charts/plex/1.7.33/charts/common-2207.0.0.tgz b/charts/plex/1.7.33/charts/common-2207.0.0.tgz new file mode 100644 index 0000000000..a29ec5c284 Binary files /dev/null and b/charts/plex/1.7.33/charts/common-2207.0.0.tgz differ diff --git a/charts/plex/1.7.33/ci/test-values.yaml b/charts/plex/1.7.33/ci/test-values.yaml new file mode 100644 index 0000000000..3c187a8728 --- /dev/null +++ b/charts/plex/1.7.33/ci/test-values.yaml @@ -0,0 +1,32 @@ +appVolumeMounts: + config: + emptyDir: true + mountPath: /config + data: + emptyDir: true + mountPath: /data + shared: + emptyDir: true + mountPath: shared + shared-logs: + emptyDir: true + mountPath: /config/Library/Application Support/Plex Media Server/Logs + transcode: + emptyDir: true + mountPath: /transcode +claimToken: '' +dnsConfig: + options: [] +emptyDirVolumes: true +enablePlexPass: false +environmentVariables: [] +extraAppVolumeMounts: +- hostPath: /mnt/extras/hello + mountPath: /mnt/extras + readOnly: true +gpuConfiguration: {} +hostNetwork: false +plexServiceTCP: + port: 32400 +timezone: Etc/UTC +updateStrategy: Recreate diff --git a/charts/plex/1.7.33/ix_values.yaml b/charts/plex/1.7.33/ix_values.yaml new file mode 100644 index 0000000000..ae9aa90581 --- /dev/null +++ b/charts/plex/1.7.33/ix_values.yaml @@ -0,0 +1,8 @@ +image: + pullPolicy: IfNotPresent + repository: plexinc/pms-docker + tag: 1.31.2.6810-a607d384f +plexpassImage: + pullPolicy: IfNotPresent + repository: plexinc/pms-docker + tag: plexpass diff --git a/charts/plex/1.7.33/migrations/migrate_from_1.0.0 b/charts/plex/1.7.33/migrations/migrate_from_1.0.0 new file mode 100755 index 0000000000..a93c1d9f47 --- /dev/null +++ b/charts/plex/1.7.33/migrations/migrate_from_1.0.0 @@ -0,0 +1,34 @@ +#!/usr/bin/python3 +import json +import os +import sys + + +def migrate(values): + values.update({ + 'appVolumeMounts': { + 'transcode': { + 'hostPathEnabled': values['transcodeHostPathEnabled'], + **({'hostPath': values['transcodeHostPath']} if values.get('transcodeHostPath') else {}) + }, + 'config': { + 'hostPathEnabled': values['configHostPathEnabled'], + **({'hostPath': values['configHostPath']} if values.get('configHostPath') else {}) + }, + 'data': { + 'hostPathEnabled': values['dataHostPathEnabled'], + **({'hostPath': values['dataHostPath']} if values.get('dataHostPath') else {}) + }, + }, + 'updateStrategy': values.get('strategyType', 'Recreate'), + }) + return values + + +if __name__ == '__main__': + if len(sys.argv) != 2: + exit(1) + + if os.path.exists(sys.argv[1]): + with open(sys.argv[1], 'r') as f: + print(json.dumps(migrate(json.loads(f.read())))) diff --git a/charts/plex/1.7.33/questions.yaml b/charts/plex/1.7.33/questions.yaml new file mode 100644 index 0000000000..ef84008462 --- /dev/null +++ b/charts/plex/1.7.33/questions.yaml @@ -0,0 +1,361 @@ +groups: + - name: "Plex Configuration" + description: "Configure plex deployment" + - name: "Networking" + description: "Configure networking for container" + - name: "Storage" + description: "Persist and share data that is separate from the lifecycle of the container" + - name: "Workload Details" + description: "Configure how workload should be deployed" + - name: "Scaling/Upgrade Policy" + description: "Configure how pods are replaced when configuration is upgraded" + - name: "Restart Policy" + description: "Configure when pod should be restarted in case of failure" + - name: "Resource Reservation" + description: "Specify resources to be allocated to workload" + - name: "Advanced DNS Settings" + description: "Configure DNS settings" + - name: "Resource Limits" + description: "Set CPU/memory limits for Kubernetes Pod" + +portals: + web_portal: + protocols: + - "http" + host: + - "$node_ip" + ports: + - "$variable-plexServiceTCP.port" + path: "/web" + +questions: + - variable: enablePlexPass + label: "Use PlexPass" + group: "Plex Configuration" + schema: + type: boolean + default: false + - variable: dnsConfig + label: "DNS Configuration" + group: "Advanced DNS Settings" + schema: + type: dict + attrs: + - variable: options + label: "DNS Options" + schema: + type: list + items: + - variable: optionsEntry + label: "Option Entry Configuration" + schema: + type: dict + attrs: + - variable: name + label: "Option Name" + schema: + type: string + required: true + - variable: value + label: "Option Value" + schema: + type: string + required: true + + - variable: claimToken + label: "Plex Claim Token" + group: "Plex Configuration" + description: "The claim token for the server to obtain a real server token. If not provided, server is will not be automatically logged in. If server is already logged in, this parameter is ignored. You can obtain a claim token to login your server to your plex account by visiting https://www.plex.tv/claim." + schema: + type: string + default: "" + + - variable: hostNetwork + label: "Configure Host Network" + group: "Networking" + schema: + type: boolean + default: false + + - variable: environmentVariables + label: "Environment Variables for Plex" + group: "Plex Configuration" + schema: + type: list + default: [] + items: + - variable: environmentVariable + label: "Environment Variable" + schema: + type: dict + attrs: + - variable: name + label: "Name" + schema: + type: string + - variable: value + label: "Value" + schema: + type: string + + - variable: timezone + label: "Plex container timezone" + group: "Plex Configuration" + schema: + type: string + default: "Etc/UTC" + $ref: + - "definitions/timezone" + + # Update strategy + - variable: updateStrategy + description: "Upgrade Policy" + label: "Update Strategy" + group: "Scaling/Upgrade Policy" + schema: + type: string + default: "Recreate" + enum: + - value: "RollingUpdate" + description: "Create new pods and then kill old ones" + - value: "Recreate" + description: "Kill existing pods before creating new ones" + + # Port configuration + - variable: plexServiceTCP + label: "Configure Plex TCP Service" + group: "Networking" + schema: + type: dict + attrs: + - variable: port + label: "Port to expose for Plex UI" + schema: + type: int + min: 9000 + max: 65535 + default: 32400 + + # Specify GPU configuration + - variable: gpuConfiguration + label: "GPU Configuration" + group: "Resource Reservation" + schema: + type: dict + $ref: + - "definitions/gpuConfiguration" + attrs: [] + + - variable: appVolumeMounts + label: "Plex Storage" + group: "Storage" + schema: + type: dict + attrs: + - variable: transcode + label: "Transcode Volume" + schema: + type: dict + attrs: + - variable: datasetName + label: "Plex Transcode Volume Name" + schema: + type: string + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "ix-plex_transcode" + hidden: true + editable: false + - variable: mountPath + label: "Plex Transcode Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + hidden: true + editable: false + default: "/transcode" + - variable: hostPathEnabled + label: "Enable Host Path for Plex Transcode Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Plex Transcode Volume" + schema: + type: hostpath + required: true + $ref: + - "validations/lockedHostPath" + - variable: data + label: "Data Volume" + schema: + type: dict + attrs: + - variable: datasetName + label: "Plex Data Volume Name" + schema: + type: string + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "ix-plex_data" + editable: false + hidden: true + - variable: mountPath + label: "Plex Data Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + hidden: true + editable: false + default: "/data" + - variable: hostPathEnabled + label: "Enable Host Path for Plex Data Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Plex Data Volume" + schema: + type: hostpath + required: true + $ref: + - "validations/lockedHostPath" + - variable: config + label: "Config Volume" + schema: + type: dict + attrs: + - variable: datasetName + label: "Plex Config Volume Name" + schema: + type: string + $ref: + - "normalize/ixVolume" + show_if: [["hostPathEnabled", "=", false]] + default: "ix-plex_config" + editable: false + hidden: true + - variable: mountPath + label: "Plex Config Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + editable: false + hidden: true + default: "/config" + - variable: hostPathEnabled + label: "Enable Host Path for Plex Config Volume" + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: "Host Path for Plex Config Volume" + schema: + type: hostpath + required: true + $ref: + - "validations/lockedHostPath" + - variable: shared + label: "Shared Volume" + schema: + type: dict + hidden: true + attrs: + - variable: emptyDir + label: "Temporary Volume" + schema: + type: boolean + default: true + editable: false + - variable: mountPath + label: "Plex Shared Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + editable: false + default: "/shared" + - variable: shared-logs + label: "Shared Logs Volume" + schema: + type: dict + hidden: true + attrs: + - variable: emptyDir + label: "Temporary Volume" + schema: + type: boolean + default: true + editable: false + - variable: mountPath + label: "Plex Shared Logs Mount Path" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + editable: false + default: "/config/Library/Application Support/Plex Media Server/Logs" + + - variable: extraAppVolumeMounts + label: "Plex Extra Host Path Volumes" + group: "Storage" + schema: + type: list + items: + - variable: extraAppVolume + label: "Plex Host Path Volume" + description: "Add an extra host path volume for plex application" + schema: + type: dict + attrs: + - variable: mountPath + label: "Mount Path in Pod" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + required: true + - variable: hostPath + label: "Host Path" + description: "Host path" + schema: + type: hostpath + required: true + $ref: + - "validations/lockedHostPath" + - variable: readOnly + label: "Read Only" + description: "Mount hostpath in read-only mode" + schema: + type: boolean + default: false + + - variable: enableResourceLimits + label: "Enable Pod resource limits" + group: "Resource Limits" + schema: + type: boolean + default: false + - variable: cpuLimit + label: "CPU Limresource limitsit" + description: "CPU resource limit allow plain integer values with suffix m(milli) e.g 1000m, 100." + group: "Resource Limits" + schema: + type: string + show_if: [["enableResourceLimits", "=", true]] + valid_chars: "^\\d+(?:\\.\\d+(?!.*m$)|m?$)" + default: "4000m" + - variable: memLimit + label: "Memory Limit" + group: "Resource Limits" + description: "Memory limits is specified by number of bytes. Followed by quantity suffix like E,P,T,G,M,k and Ei,Pi,Ti,Mi,Gi,Ki can also be used. e.g 129e6, 129M, 128974848000m, 123Mi" + schema: + type: string + show_if: [["enableResourceLimits", "=", true]] + valid_chars: "^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$" + default: "8Gi" diff --git a/charts/plex/1.7.33/templates/NOTES.txt b/charts/plex/1.7.33/templates/NOTES.txt new file mode 100644 index 0000000000..f3d1e07cb1 --- /dev/null +++ b/charts/plex/1.7.33/templates/NOTES.txt @@ -0,0 +1,3 @@ +1. Get the application URL by running these commands: + +http://$node_ip:{{ .Values.plexServiceTCP.port }}/ diff --git a/charts/plex/1.7.33/templates/deployment.yaml b/charts/plex/1.7.33/templates/deployment.yaml new file mode 100644 index 0000000000..164858ba0e --- /dev/null +++ b/charts/plex/1.7.33/templates/deployment.yaml @@ -0,0 +1,103 @@ +{{ include "common.storage.hostPathValidate" .Values }} +{{ include "common.deployment.common_config" . | nindent 0 }} +spec: {{ include "common.deployment.common_spec" . | nindent 2 }} + template: {{ include "common.deployment.pod.metadata" . | nindent 4 }} + spec: + hostNetwork: {{ .Values.hostNetwork }} + {{- if .Values.hostNetwork }} + dnsPolicy: ClusterFirstWithHostNet + {{- end }} + hostname: {{ template "common.names.fullname" . }} + containers: + - name: {{ .Chart.Name }} + {{ include "common.resources.limitation" . | nindent 10 }} + {{ if .Values.enablePlexPass }} + {{ include "common.containers.imageConfig" .Values.plexpassImage | nindent 10 }} + {{ else }} + {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} + {{ end }} + volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + mountPath: {{ $hostPathConfiguration.mountPath }} + {{ if $hostPathConfiguration.readOnly }} + readOnly: {{ $hostPathConfiguration.readOnly }} + {{ end }} + {{ end }} + 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 + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + {{ $envList := (default list .Values.environmentVariables) }} + {{ if and .Values.gpuConfiguration (hasKey .Values.gpuConfiguration "nvidia.com/gpu") (gt (get .Values.gpuConfiguration "nvidia.com/gpu" | toDecimal) 0) }} + {{ $envList = mustAppend $envList (dict "name" "NVIDIA_DRIVER_CAPABILITIES" "value" "all") }} + {{ end }} + {{ $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 + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 5 + successThreshold: 2 + livenessProbe: + httpGet: + path: /identity + port: 32400 + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 5 + successThreshold: 1 + startupProbe: + httpGet: + path: /identity + port: 32400 + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 2 + failureThreshold: 60 + successThreshold: 1 + {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} + volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + hostPath: + path: {{ $hostPathConfiguration.hostPath }} + {{ end }} diff --git a/charts/plex/1.7.33/templates/service-tcp.yaml b/charts/plex/1.7.33/templates/service-tcp.yaml new file mode 100644 index 0000000000..4fec88260b --- /dev/null +++ b/charts/plex/1.7.33/templates/service-tcp.yaml @@ -0,0 +1,16 @@ +{{ $svc := .Values.plexServiceTCP }} +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "pms" "port" $svc.port "nodePort" $svc.port "targetPort" "pms") }} +{{ $ports = mustAppend $ports (dict "name" "http" "port" 80 "targetPort" "pms") }} +{{ $ports = mustAppend $ports (dict "name" "https" "port" 443 "targetPort" "pms") }} +{{ $ports = mustAppend $ports (dict "name" "plex-dlna" "port" 1900 "targetPort" "plex-dlna") }} +{{ $params := . }} +{{ $_ := set $params "commonService" (dict "ports" $ports ) }} +{{ if .Values.hostNetwork }} +{{ $_ := set $params.commonService "nameSuffix" "tcp-cluster-ip" }} +{{ $_1 := set $params.commonService "type" "ClusterIP" }} +{{ else }} +{{ $_ := set $params.commonService "nameSuffix" "tcp" }} +{{ $_1 := set $params.commonService "type" "NodePort" }} +{{ end }} +{{ include "common.classes.service" $params }} diff --git a/charts/plex/1.7.33/templates/service-udp.yaml b/charts/plex/1.7.33/templates/service-udp.yaml new file mode 100644 index 0000000000..5a84addc99 --- /dev/null +++ b/charts/plex/1.7.33/templates/service-udp.yaml @@ -0,0 +1,9 @@ +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "plex-dlna-udp" "port" 1900 "protocol" "UDP" "targetPort" "plex-dlna-udp") }} +{{ $ports = mustAppend $ports (dict "name" "plex-gdm1" "port" 32410 "protocol" "UDP" "targetPort" "plex-gdm1") }} +{{ $ports = mustAppend $ports (dict "name" "plex-gdm2" "port" 32412 "protocol" "UDP" "targetPort" "plex-gdm2") }} +{{ $ports = mustAppend $ports (dict "name" "plex-gdm3" "port" 32413 "protocol" "UDP" "targetPort" "plex-gdm3") }} +{{ $ports = mustAppend $ports (dict "name" "plex-gdm4" "port" 32414 "protocol" "UDP" "targetPort" "plex-gdm4") }} +{{ $params := . }} +{{ $_ := set $params "commonService" (dict "type" "ClusterIP" "ports" $ports "nameSuffix" "udp" ) }} +{{ include "common.classes.service" $params }} diff --git a/charts/plex/item.yaml b/charts/plex/item.yaml new file mode 100644 index 0000000000..8d014b680d --- /dev/null +++ b/charts/plex/item.yaml @@ -0,0 +1,3 @@ +categories: + - entertainment +icon_url: https://www.plex.tv/wp-content/uploads/2018/01/pmp-icon-1.png