provisioning/templates/services/k8s-deploy/prxy-gateway-deploy.yaml.j2
2026-01-12 04:43:06 +00:00

35 lines
875 B
Django/Jinja

---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: {{k8s_deploy.namespace}}-gwy
namespace: istio-system
spec:
selector:
istio: ingressgateway # use istio default ingress gateway
servers:
{%- for prxy in k8s_deploy.prxyGatewayServers %}
- port:
number: {{ prxy.port.number }}
name: {{ prxy.port.name }}
protocol: {{ prxy.port.proto }}
{%- if prxy.tls %}
tls:
{%- if prxy.tls.httpsRedirect %}
httpsRedirect: true
{%- endif %}
{%- if prxy.tls.mode and prxy.tls.mode != "" %}
mode: {{prxy.tls.mode}}
{%- endif %}
{%- if prxy.tls.credentialName %}
credentialName: {{prxy.tls.credentialName}}
{%- endif %}
{%- endif %}
{%- if prxy.hosts %}
hosts:
{%- for host in prxy.hosts %}
- "{{host}}"
{%- endfor %}
{%- endif %}
{%- endfor %}