feat: always skip the https ingress/ingress-route/deployment port entry if there is a corresponding http entry
Also inject the corresponding entries as necessary
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
{{- $processName := "PROCESS_NAME" }}
|
||||
{{- $config := index .Values.processes "PROCESS_NAME" }}
|
||||
{{- $mappings := dict }}
|
||||
{{- range $pdx, $port_map := $config.web.port_maps }}
|
||||
{{- $mappings := set $mappings $port_map.name "true" }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@@ -76,6 +80,9 @@ spec:
|
||||
{{- if eq $processName "web" }}
|
||||
ports:
|
||||
{{- 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 }}
|
||||
- containerPort: {{ $port_map.container_port }}
|
||||
name: {{ $port_map.name }}
|
||||
protocol: {{ $port_map.protocol }}
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
{{- $processName := "PROCESS_NAME" }}
|
||||
{{- $config := index .Values.processes "PROCESS_NAME" }}
|
||||
{{- if and $config.web.domains (eq $.Values.global.network.ingress_class "traefik") }}
|
||||
{{- $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: traefik.io/v1alpha1
|
||||
kind: IngressRoute
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
{{- $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
|
||||
|
||||
Reference in New Issue
Block a user