As the command contains a colon, it must be handled in the commands binary as opposed to subcommands. Also include a simple bats test.
56 lines
2.0 KiB
YAML
56 lines
2.0 KiB
YAML
{{- $processName := "PROCESS_NAME" }}
|
|
{{- $config := index .Values.processes "PROCESS_NAME" }}
|
|
{{- if and $config.web.domains (eq $.Values.global.network.ingress_class "traefik") }}
|
|
{{- range $pdx, $port_map := $config.web.port_maps }}
|
|
---
|
|
apiVersion: traefik.io/v1alpha1
|
|
kind: IngressRoute
|
|
metadata:
|
|
annotations:
|
|
dokku.com/managed: "true"
|
|
{{- if and $.Values.global.annotations $.Values.global.annotations.traefik_ingressroute }}
|
|
{{- range $k, $v := $.Values.global.annotations.traefik_ingressroute }}
|
|
{{ $k }}: {{ $v | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if and $config.annotations $config.annotations.traefik_ingressroute }}
|
|
{{- range $k, $v := $config.annotations.traefik_ingressroute }}
|
|
{{ $k }}: {{ $v | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
labels:
|
|
app.kubernetes.io/instance: {{ $.Values.global.app_name }}-{{ $processName }}
|
|
app.kubernetes.io/name: {{ $processName }}
|
|
app.kubernetes.io/part-of: {{ $.Values.global.app_name }}
|
|
name: {{ $.Values.global.app_name }}-{{ $processName }}-{{ $port_map.name }}
|
|
namespace: {{ $.Values.global.namespace }}
|
|
spec:
|
|
entryPoints:
|
|
{{- if and $config.web.tls.enabled (eq $port_map.scheme "https") }}
|
|
- websecure
|
|
{{- else }}
|
|
- web
|
|
{{- end }}
|
|
routes:
|
|
{{- range $ddx, $domain := $config.web.domains }}
|
|
- kind: Rule
|
|
match: Host(`{{ $domain }}`)
|
|
{{- if and $config.web.tls.enabled (and (eq $port_map.scheme "http") $port_map.redirect_to_https) }}
|
|
middlewares:
|
|
- name: {{ $.Values.global.app_name}}-{{ $processName }}-redirect-to-https
|
|
namespace: {{ $.Values.global.namespace }}
|
|
{{- end }}
|
|
services:
|
|
- name: {{ $.Values.global.app_name }}-{{ $processName }}
|
|
namespace: {{ $.Values.global.namespace }}
|
|
passHostHeader: true
|
|
port: {{ $port_map.name }}
|
|
scheme: http
|
|
{{- end }}
|
|
{{- if and $config.web.tls.enabled (eq $port_map.scheme "https") }}
|
|
tls:
|
|
secretName: tls-{{ $.Values.global.app_name }}-{{ $processName }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|