Skip to content

Commit

Permalink
Merge pull request #41 from hansaya/main
Browse files Browse the repository at this point in the history
Automatically populate advertise IP
  • Loading branch information
ressu authored Feb 21, 2023
2 parents 786fb83 + 1ffdc8f commit 834974e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions charts/kube-plex/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,22 @@ spec:
# Extra ENV variables
{{- with .Values.extraEnv }}
{{- get (fromYaml (include "env_vars" $)) "env" | toYaml | nindent 8 -}}
{{- end }}
# Fill ADVERTISE_IP section in plex automatically
{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }}
- name: ADVERTISE_IP
value: |
{{ if .Values.ingress.hosts }}https://{{ join ",https://" .Values.ingress.hosts }}{{ end }}
{{ if .Values.ingress.hosts }},https://{{ join ",https://" .Values.ingress.hosts }}:443{{ end }}
{{- else if eq .Values.service.type "LoadBalancer" }}
{{- if (or .Values.service.loadBalancerIP .Values.ingress.hosts (index .Values.service.annotations "dns.pfsense.org/hostname")) }}
- name: ADVERTISE_IP
value: |
{{ if .Values.service.loadBalancerIP }}https://{{ .Values.service.loadBalancerIP }}:32400{{ end }}
{{ if index .Values.service.annotations "dns.pfsense.org/hostname" }},https://{{ join ",https://" (splitList "," (index .Values.service.annotations "dns.pfsense.org/hostname")) }}:32400{{ end }}
{{ if .Values.ingress.hosts }},https://{{ join ",https://" .Values.ingress.hosts }}{{ end }}
{{ if .Values.ingress.hosts }},https://{{ join ",https://" .Values.ingress.hosts }}:443{{ end }}
{{- end }}
{{- end }}
volumeMounts:
- name: data
Expand Down

0 comments on commit 834974e

Please sign in to comment.