2022-11-14 20:08:58 +00:00
|
|
|
{{/* Make sure all variables are set properly */}}
|
2023-04-29 06:43:02 +00:00
|
|
|
{{- include "tc.v1.common.loader.init" . -}}
|
2022-11-14 20:08:58 +00:00
|
|
|
|
|
|
|
{{- $adv := list -}}
|
2023-04-29 06:43:02 +00:00
|
|
|
{{- $serverURL := "" -}}
|
|
|
|
{{- $protocol := "http" -}}
|
|
|
|
{{- if .Values.plex.requireHTTPS -}}
|
|
|
|
{{- $protocol = "https" -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2023-04-30 14:46:40 +00:00
|
|
|
{{- $_ := set .Values.workload.main.podSpec.containers.main.probes.liveness "scheme" $protocol -}}
|
|
|
|
{{- $_ := set .Values.workload.main.podSpec.containers.main.probes.readiness "scheme" $protocol -}}
|
|
|
|
{{- $_ := set .Values.workload.main.podSpec.containers.main.probes.startup "scheme" $protocol -}}
|
|
|
|
{{- $_ := set .Values.service.main.ports.main "protocol" $protocol -}}
|
2023-04-29 06:43:02 +00:00
|
|
|
|
|
|
|
{{- if not (eq .Values.service.main.type "ClusterIP") -}}
|
|
|
|
{{- $serverURL = (printf "%v://%v:%v" $protocol .Values.plex.serverIP .Values.service.main.ports.main.port) -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $serverIngressURL := "" -}}
|
|
|
|
{{- $host := "" -}}
|
|
|
|
{{- if .Values.ingress.main.enabled -}}
|
|
|
|
{{- with (first .Values.ingress.main.hosts) -}}
|
|
|
|
{{- $host = .host -}}
|
|
|
|
{{- $serverIngressURL = (printf "https://%v" .host) -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $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 -}}
|
2022-11-14 20:08:58 +00:00
|
|
|
{{- $adv = append $adv . -}}
|
2023-04-29 06:43:02 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{- with $serverIngressURL -}}
|
2022-11-14 20:08:58 +00:00
|
|
|
{{- $adv = append $adv . -}}
|
2023-04-29 06:43:02 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{- with $serverIngressURLPort -}}
|
2022-11-14 20:08:58 +00:00
|
|
|
{{- $adv = append $adv . -}}
|
2023-04-29 06:43:02 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{- with .Values.plex.additionalAdvertiseURL -}}
|
2022-11-14 20:08:58 +00:00
|
|
|
{{- $adv = append $adv . -}}
|
2023-04-29 06:43:02 +00:00
|
|
|
{{- end -}}
|
2022-11-14 20:08:58 +00:00
|
|
|
|
2023-04-29 06:43:02 +00:00
|
|
|
{{- $_ := set .Values.workload.main.podSpec.containers.main.env "ADVERTISE_IP" (join "," $adv) -}}
|
2022-11-14 20:08:58 +00:00
|
|
|
|
|
|
|
{{/* Render the templates */}}
|
2023-04-29 06:43:02 +00:00
|
|
|
{{- include "tc.v1.common.loader.apply" . -}}
|