Skip to content

Commit

Permalink
refactor: ingress object per service
Browse files Browse the repository at this point in the history
Signed-off-by: Gabor Boros <[email protected]>
  • Loading branch information
gabor-boros committed May 9, 2024
1 parent db7b2bd commit f5b8c17
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
# For multi-instance clusters. Allow one central load balancer on the cluster to
# handle HTTPS certs and forward traffic to each Open edX instance's Caddy
# instance.
{%- set HOSTS = [LMS_HOST, CMS_HOST, PREVIEW_HOST, MFE_HOST] + K8S_HARMONY_ADDITIONAL_INGRESS_HOST_LIST %}
{%- HOSTS.append(ECOMMERCE_HOST) if ECOMMERCE_HOST is defined %}
{%- HOSTS.append(DISCOVERY_HOST) if DISCOVERY_HOST is defined %}
{%- set tmp = HOSTS.append(ECOMMERCE_HOST) if ECOMMERCE_HOST is defined %}
{%- set tmp = HOSTS.append(DISCOVERY_HOST) if DISCOVERY_HOST is defined %}
{%- for host in HOSTS %}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: central-lb-to-caddy-ingress
name: {{ host | replace(".", "-") }}-to-caddy
namespace: {{ K8S_NAMESPACE }}
labels:
app.kubernetes.io/component: ingress
Expand All @@ -18,7 +19,6 @@ metadata:
spec:
ingressClassName: {{ K8S_HARMONY_INGRESS_CLASS_NAME }}
rules:
{%- for host in HOSTS if host is defined %}
- host: "{{ host }}"
http:
paths:
Expand All @@ -29,10 +29,9 @@ spec:
name: caddy
port:
number: {{ CADDY_HTTP_PORT }}
{%- endfor %}
tls:
- hosts:
{%- for host in HOSTS if host is defined %}
- {{ host -}}
{% endfor %}
- {{ host }}
secretName: central-lb-ingress-tls
{%- endfor %}

0 comments on commit f5b8c17

Please sign in to comment.