TrueChartsClone/charts/stable/traefik/templates/_portalhook.tpl

27 lines
708 B
Smarty
Raw Normal View History

{{/* Define the portalHook */}}
{{- define "traefik.portalhook" -}}
2021-09-03 18:58:30 +00:00
{{- if .Values.portalhook.enabled }}
{{- $namespace := ( printf "ix-%s" .Release.Name ) }}
{{- if or ( not .Values.ingressClass.enabled ) ( and ( .Values.ingressClass.enabled ) ( .Values.ingressClass.isDefaultClass ) ) }}
{{- $namespace = "default" }}
2021-09-03 18:58:30 +00:00
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: portalhook
2021-09-03 19:41:32 +00:00
namespace: {{ $namespace }}
2021-09-03 18:58:30 +00:00
data:
{{- $ports := dict }}
{{- range $.Values.service }}
{{- range $name, $value := .ports }}
{{- $_ := set $ports $name $value }}
{{- end }}
{{- end }}
{{- range $name, $value := $ports }}
2021-09-03 19:27:17 +00:00
{{ $name }}: {{ $value.port | quote }}
2021-09-03 18:58:30 +00:00
{{- end }}
{{- end }}
{{- end -}}