62 lines
2.1 KiB
YAML
62 lines
2.1 KiB
YAML
{{- $processName := "PROCESS_NAME" }}
|
|
{{- $config := index .Values.processes "PROCESS_NAME" }}
|
|
{{- if and $config.web.domains (eq $.Values.global.network.ingress_class "nginx") }}
|
|
{{- $mappings := dict }}
|
|
{{- range $pdx, $port_map := $config.web.port_maps }}
|
|
{{- $mappings := set $mappings $port_map.name "true" }}
|
|
{{- end }}
|
|
{{- range $pdx, $port_map := $config.web.port_maps }}
|
|
{{- if and (eq $port_map.scheme "https") (hasKey $mappings (printf "http-80-%.0f" $port_map.container_port)) }}
|
|
{{- continue }}
|
|
{{- end }}
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
annotations:
|
|
dokku.com/managed: "true"
|
|
{{- if and $.Values.global.annotations $.Values.global.annotations.deployment }}
|
|
{{- range $k, $v := $.Values.global.annotations.deployment }}
|
|
{{ $k }}: {{ $v | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if and $config.annotations $config.annotations.ingress }}
|
|
{{- range $k, $v := $config.annotations.ingress }}
|
|
{{ $k }}: {{ $v | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if $config.web.tls.enabled }}
|
|
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
|
|
{{- 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:
|
|
ingressClassName: nginx
|
|
{{- if $config.web.tls.enabled }}
|
|
tls:
|
|
- hosts:
|
|
{{- range $ddx, $domain := $config.web.domains }}
|
|
- {{ $domain | quote }}
|
|
{{- end }}
|
|
secretName: tls-{{ $.Values.global.app_name }}-{{ $processName }}
|
|
{{- end }}
|
|
rules:
|
|
{{- range $ddx, $domain := $config.web.domains }}
|
|
- host: {{ $domain | quote }}
|
|
http:
|
|
paths:
|
|
- backend:
|
|
service:
|
|
name: {{ $.Values.global.app_name }}-{{ $processName }}
|
|
port:
|
|
name: {{ $port_map.name }}
|
|
pathType: ImplementationSpecific
|
|
path: /
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|