_portal.tpl 701 B

1234567891011121314151617181920212223242526272829
  1. {{- define "passbolt.portal" -}}
  2. {{- $url := urlParse .Values.passboltConfig.appUrl -}}
  3. {{- $protocol := "http" -}}
  4. {{- if $url.scheme -}}
  5. {{- $protocol = $url.scheme -}}
  6. {{- end -}}
  7. {{- $host := "$node_ip" -}}
  8. {{- $port := ternary "443" "80" (eq $protocol "https") -}}
  9. {{- if $url.host -}}
  10. {{- if contains ":" $url.host -}}
  11. {{- $port = (split ":" $url.host)._1 -}}
  12. {{- $host = (split ":" $url.host)._0 -}}
  13. {{- else -}}
  14. {{- $host = $url.host -}}
  15. {{- end -}}
  16. {{- end }}
  17. ---
  18. apiVersion: v1
  19. kind: ConfigMap
  20. metadata:
  21. name: portal
  22. data:
  23. path: /
  24. port: {{ $port | quote }}
  25. protocol: {{ $protocol | quote }}
  26. host: {{ $host | quote }}
  27. {{- end -}}