diff --git a/charts/stable/plex/ci/basic-values.yaml b/charts/stable/plex/ci/basic-values.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/charts/stable/plex/ci/https-values.yaml b/charts/stable/plex/ci/https-values.yaml new file mode 100644 index 00000000000..de386234206 --- /dev/null +++ b/charts/stable/plex/ci/https-values.yaml @@ -0,0 +1,2 @@ +plex: + requireHTTPS: true diff --git a/charts/stable/plex/questions.yaml b/charts/stable/plex/questions.yaml index f64f1ebc3f7..411b55bcf1f 100644 --- a/charts/stable/plex/questions.yaml +++ b/charts/stable/plex/questions.yaml @@ -7,11 +7,9 @@ questions: # Include{global} # Include{workload} # Include{workloadDeployment} - # Include{replicas1} # Include{podSpec} # Include{containerMain} - - variable: env group: App Configuration label: Image Environment @@ -31,11 +29,8 @@ questions: schema: type: string default: "" - # Include{containerBasic} # Include{containerAdvanced} - - - variable: plex group: App Configuration label: Plex Configuration @@ -64,8 +59,15 @@ questions: schema: type: boolean default: true + - variable: requireHTTPS + label: Require HTTPS + description: Please use this toggle to "Require HTTPS", do not use the Plex UI. + schema: + type: boolean + default: true # Include{containerConfig} +# Include{podOptions} # Include{serviceRoot} # Include{serviceMain} # Include{serviceSelectorLoadBalancer} @@ -109,7 +111,6 @@ questions: # Include{ingressTraefik} # Include{ingressList} # Include{securityContextRoot} - - variable: runAsUser label: "runAsUser" description: "The UserID of the user running the application" @@ -131,7 +132,6 @@ questions: schema: type: int default: 568 - # Include{resources} # Include{advanced} # Include{addons} diff --git a/charts/stable/plex/templates/common.yaml b/charts/stable/plex/templates/common.yaml index 39feeab8ab5..821a261b085 100644 --- a/charts/stable/plex/templates/common.yaml +++ b/charts/stable/plex/templates/common.yaml @@ -1,43 +1,52 @@ {{/* Make sure all variables are set properly */}} -{{- include "tc.v1.common.loader.init" . }} +{{- include "tc.v1.common.loader.init" . -}} {{- $adv := list -}} -{{- $serverURL := "" }} -{{- if not (eq .Values.service.main.type "ClusterIP") }} - {{- $serverURL = (printf "%v://%v:%v" (.Values.service.main.ports.main.protocol | lower) .Values.plex.serverIP .Values.service.main.ports.main.port) }} -{{- end }} +{{- $serverURL := "" -}} +{{- $protocol := "http" -}} +{{- if .Values.plex.requireHTTPS -}} + {{- $protocol = "https" -}} +{{- end -}} -{{- $serverIngressURL := "" }} -{{- $host := "" }} -{{- if .Values.ingress.main.enabled }} - {{- with (first .Values.ingress.main.hosts) }} - {{- $host = .host }} - {{- $serverIngressURL = (printf "https://%v" .host) }} - {{- end }} -{{- end }} +{{- $_ := set .Values.workload.main.podSpec.containers.main.probes.liveness "protocol" $protocol -}} +{{- $_ := set .Values.workload.main.podSpec.containers.main.probes.readiness "protocol" $protocol -}} +{{- $_ := set .Values.workload.main.podSpec.containers.main.probes.startup "protocol" $protocol -}} -{{- $serverIngressURLPort := "" }} -{{- if $host }} - {{- if not (eq .Values.service.main.type "ClusterIP") }} - {{- $port := .Values.service.main.ports.main.port }} - {{- $serverIngressURLPort = printf "https://%v:%v" $host $port }} - {{- end }} -{{- end }} +{{- if not (eq .Values.service.main.type "ClusterIP") -}} + {{- $serverURL = (printf "%v://%v:%v" $protocol .Values.plex.serverIP .Values.service.main.ports.main.port) -}} +{{- end -}} -{{- with $serverURL }} - {{- $adv = append $adv . -}} -{{- end }} -{{- with $serverIngressURL }} - {{- $adv = append $adv . -}} -{{- end }} -{{- with $serverIngressURLPort }} - {{- $adv = append $adv . -}} -{{- end }} -{{- with .Values.plex.additionalAdvertiseURL }} - {{- $adv = append $adv . -}} -{{- end }} +{{- $serverIngressURL := "" -}} +{{- $host := "" -}} +{{- if .Values.ingress.main.enabled -}} + {{- with (first .Values.ingress.main.hosts) -}} + {{- $host = .host -}} + {{- $serverIngressURL = (printf "https://%v" .host) -}} + {{- end -}} +{{- end -}} -{{- $_ := set .Values.workload.main.podSpec.containers.main.env "ADVERTISE_IP" (join "," $adv) }} +{{- $serverIngressURLPort := "" -}} +{{- if $host -}} + {{- if not (eq .Values.service.main.type "ClusterIP") -}} + {{- $port := .Values.service.main.ports.main.port -}} + {{- $serverIngressURLPort = printf "https://%v:%v" $host $port -}} + {{- end -}} +{{- end -}} + +{{- with $serverURL -}} + {{- $adv = append $adv . -}} +{{- end -}} +{{- with $serverIngressURL -}} + {{- $adv = append $adv . -}} +{{- end -}} +{{- with $serverIngressURLPort -}} + {{- $adv = append $adv . -}} +{{- end -}} +{{- with .Values.plex.additionalAdvertiseURL -}} + {{- $adv = append $adv . -}} +{{- end -}} + +{{- $_ := set .Values.workload.main.podSpec.containers.main.env "ADVERTISE_IP" (join "," $adv) -}} {{/* Render the templates */}} -{{ include "tc.v1.common.loader.apply" . }} +{{- include "tc.v1.common.loader.apply" . -}} diff --git a/charts/stable/plex/values.yaml b/charts/stable/plex/values.yaml index 2ce76350f91..32890c0d2da 100644 --- a/charts/stable/plex/values.yaml +++ b/charts/stable/plex/values.yaml @@ -9,27 +9,45 @@ service: protocol: http port: 32400 targetPort: 32400 + persistence: config: enabled: true mountPath: "/config" + plex: # User Defined serverIP: "127.0.0.1" additionalAdvertiseURL: "" disableGDM: true - -portal: - open: - enabled: true + requireHTTPS: true workload: main: podSpec: containers: main: + probes: + liveness: + enabled: true + path: /identity + protocol: http + readiness: + enabled: true + path: /identity + protocol: http + startup: + enabled: true + path: /identity + protocol: http env: PLEX_PREFERENCE_GDM: 'GdmEnabled={{ ternary "0" "1" .Values.plex.disableGDM }}' + # 0=Required, 1=Preferred + PLEX_PREFERENCE_SEC_CON: 'secureConnections={{ ternary "0" "1" .Values.plex.requireHTTPS }}' # User Defined ALLOWED_NETWORKS: "172.16.0.0/12,10.0.0.0/8,192.168.0.0/16" PLEX_CLAIM: "" + +portal: + open: + enabled: true diff --git a/templates/questions/security/securityContextContainer.yaml b/templates/questions/security/securityContextContainer.yaml index 521550e64e9..451f5d43c79 100644 --- a/templates/questions/security/securityContextContainer.yaml +++ b/templates/questions/security/securityContextContainer.yaml @@ -4,7 +4,7 @@ description: When supported by the container, this sets the User ID running the Application Process. Not supported by all Apps schema: type: int - show_if: [["runAsUser", "=", "0"]] + show_if: [["runAsUser", "=", 0]] default: 568 - variable: UMASK label: UMASK