Commit 17966e29 authored by Waqar Ahmed's avatar Waqar Ahmed

Update plex chart format

parent 1e7b1845
def migrate(values):
values['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 {})
},
}
return values
...@@ -141,122 +141,153 @@ questions: ...@@ -141,122 +141,153 @@ questions:
max: 65535 max: 65535
default: 32400 default: 32400
- variable: transcodeHostPathEnabled # Specify GPU configuration
label: "Configure Host Path for Transcode" - variable: gpuConfiguration
group: "Storage" label: "GPU Configuration"
schema: group: "Resource Reservation"
type: boolean
default: false
show_subquestions_if: true
subquestions:
- variable: transcodeHostPath
label: "Specify HostPath for Transcode"
schema: schema:
type: hostpath type: dict
required: true $ref:
- "definitions/gpuConfiguration"
- variable: transcodeVolume - variable: appVolumeMounts
label: "Transcode Volume Defaults" label: "Plex Storage"
group: "Storage" group: "Storage"
schema: schema:
type: dict type: dict
show_if: [["transcodeHostPathEnabled", "=", false]] attrs:
- variable: transcode
label: "Transcode Volume"
schema:
type: dict
attrs:
- variable: datasetName
label: "Plex Transcode Volume Dataset Name"
schema:
type: string
$ref: $ref:
- "normalize/ixVolume" - "normalize/ixVolume"
attrs: show_if: [["hostPathEnabled", "=", false]]
default: "ix-plex_transcode"
editable: false
- variable: mountPath - variable: mountPath
label: "Mount Path" label: "Plex Transcode Mount Path"
description: "Path where the volume will be mounted inside the pod" description: "Path where the volume will be mounted inside the pod"
schema: schema:
type: path type: path
editable: false editable: false
default: "/transcode" default: "/transcode"
- variable: datasetName - variable: hostPathEnabled
label: "Transcode Dataset Name" label: "Enable Host Path for Plex Transcode Volume"
schema:
type: string
default: "ix-plex_transcode"
editable: false
- variable: dataHostPathEnabled
label: "Configure Host Path for Data"
group: "Storage"
schema: schema:
type: boolean type: boolean
default: false default: false
show_subquestions_if: true show_subquestions_if: true
subquestions: subquestions:
- variable: dataHostPath - variable: hostPath
label: "Specify HostPath for Data" label: "Host Path for Plex Transcode Volume"
schema: schema:
type: hostpath type: hostpath
required: true required: true
- variable: data
- variable: dataVolume label: "Data Volume"
label: "Data Volume Defaults"
group: "Storage"
schema: schema:
type: dict type: dict
show_if: [["dataHostPathEnabled", "=", false]] attrs:
- variable: datasetName
label: "Plex Data Volume Dataset Name"
schema:
type: string
$ref: $ref:
- "normalize/ixVolume" - "normalize/ixVolume"
attrs: show_if: [["hostPathEnabled", "=", false]]
default: "ix-plex_data"
editable: false
- variable: mountPath - variable: mountPath
label: "Mount Path" label: "Plex Data Mount Path"
description: "Path where the volume will be mounted inside the pod" description: "Path where the volume will be mounted inside the pod"
schema: schema:
type: path type: path
editable: false editable: false
default: "/data" 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
- variable: config
label: "Config Volume"
schema:
type: dict
attrs:
- variable: datasetName - variable: datasetName
label: "Data Dataset Name" label: "Plex Config Volume Dataset Name"
schema: schema:
type: string type: string
default: "ix-plex_data" $ref:
- "normalize/ixVolume"
show_if: [["hostPathEnabled", "=", false]]
default: "ix-plex_config"
editable: false editable: false
- variable: mountPath
- variable: configHostPathEnabled label: "Plex Config Mount Path"
label: "Configure Host Path for Config" description: "Path where the volume will be mounted inside the pod"
group: "Storage" schema:
type: path
editable: false
default: "/config"
- variable: hostPathEnabled
label: "Enable Host Path for Plex Config Volume"
schema: schema:
type: boolean type: boolean
default: false default: false
show_subquestions_if: true show_subquestions_if: true
subquestions: subquestions:
- variable: configHostPath - variable: hostPath
label: "Specify HostPath for Config" label: "Host Path for Plex Config Volume"
schema: schema:
type: hostpath type: hostpath
required: true required: true
- variable: shared
- variable: configVolume label: "Shared Volume"
label: "Configuration Volume Defaults"
group: "Storage"
schema: schema:
type: dict type: dict
show_if: [["configHostPathEnabled", "=", false]]
$ref:
- "normalize/ixVolume"
attrs: attrs:
- variable: emptyDir
label: "Temporary Volume"
schema:
type: boolean
default: true
editable: false
- variable: mountPath - variable: mountPath
label: "Mount Path" label: "Plex Shared Mount Path"
description: "Path where the volume will be mounted inside the pod" description: "Path where the volume will be mounted inside the pod"
schema: schema:
type: path type: path
editable: false editable: false
default: "/config" default: "/shared"
- variable: datasetName - variable: shared-logs
label: "Configuration Dataset Name" label: "Shared Logs Volume"
schema: schema:
type: string type: dict
default: "ix-plex_config" attrs:
- variable: emptyDir
label: "Temporary Volume"
schema:
type: boolean
default: true
editable: false editable: false
- variable: mountPath
# Specify GPU configuration label: "Plex Shared Logs Mount Path"
- variable: gpuConfiguration description: "Path where the volume will be mounted inside the pod"
label: "GPU Configuration"
group: "Resource Reservation"
schema: schema:
type: dict type: path
$ref: editable: false
- "definitions/gpuConfiguration" default: "/config/Library/Application Support/Plex Media Server/Logs"
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: {{ include "common.deployment.metadata" . | nindent 0 }}
name: {{ include "common.names.fullname" . }} spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
labels: {{ include "common.labels" . | nindent 4 }} template: {{ include "common.deployment.pod.metadata" . | 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: spec:
{{- if .Values.hostNetwork }} {{- if .Values.hostNetwork }}
hostNetwork: {{ .Values.hostNetwork }} hostNetwork: {{ .Values.hostNetwork }}
...@@ -22,6 +11,8 @@ spec: ...@@ -22,6 +11,8 @@ spec:
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }} {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
{{ include "common.storage.allContainerVolumeMounts" .Values | nindent 10 }}
{{ include "common.containers.gpuConfiguration" .Values | nindent 10 }}
ports: ports:
- name: pms - name: pms
protocol: TCP protocol: TCP
...@@ -77,28 +68,4 @@ spec: ...@@ -77,28 +68,4 @@ spec:
initialDelaySeconds: 5 initialDelaySeconds: 5
failureThreshold: 40 failureThreshold: 40
periodSeconds: 15 periodSeconds: 15
volumeMounts: {{ include "common.storage.allAppVolumes" .Values | nindent 6 }}
- 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 }}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment