diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index f4b5b0c..11b0a67 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -14,6 +14,16 @@ {{ if .Values.global.routing.type }}{{ .Values.global.routing.type }}{{ else }}{{ .Values.routing.type }}{{ end }} {{- end -}} +{{- define "app.routing.service" -}} + {{- if .Values.routing.service.name -}} + {{- .Values.routing.service.name -}} + {{- else if .Values.service.name -}} + {{- .Values.service.name -}} + {{- else -}} + {{- template "app.fullname" $ }} + {{- end -}} +{{- end -}} + {{- define "app.ingress.host" -}} {{ if .Values.routing.backend }} {{ template "app.fullname" $ }}-{{ .Release.Namespace }}.{{ .Values.global.default_url | default .Values.routing.default_url }} diff --git a/templates/ingress-traefik.yaml b/templates/ingress-traefik.yaml index 8da90f4..47d591d 100644 --- a/templates/ingress-traefik.yaml +++ b/templates/ingress-traefik.yaml @@ -24,7 +24,7 @@ spec: {{ end }} services: - kind: Service - name: {{ template "app.fullname" $ }} - port: {{ .Values.service.port }} + name: {{ include "app.routing.service" $ }} + port: {{ .Values.routing.service.port | default .Values.service.port }} {{ end }} {{ end }} diff --git a/values.yaml b/values.yaml index 789cdf5..2936020 100644 --- a/values.yaml +++ b/values.yaml @@ -74,6 +74,13 @@ routing: # traefik middleware name name: + # custom service name and port for the routing + service: + # custom service name only for routing + name: + # custom service port only for routing + port: + # Replicas replicas: 1