Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: extend ingress hosts #74

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
---
# 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_INGRESS_HOST_LIST %}
{%- set HOSTS = [LMS_HOST, CMS_HOST] + K8S_HARMONY_ADDITIONAL_INGRESS_HOST_LIST %}
{%- set tmp = HOSTS.append(PREVIEW_HOST) if PREVIEW_HOST is defined %}
{%- set tmp = HOSTS.append(MFE_HOST) if MFE_HOST is defined %}
gabor-boros marked this conversation as resolved.
Show resolved Hide resolved
{%- 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
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 100m
cert-manager.io/cluster-issuer: harmony-letsencrypt-global
spec:
ingressClassName: {{ K8S_HARMONY_INGRESS_CLASS_NAME }}
rules:
{%- for host in HOSTS if host is defined %}
- host: "{{ host }}"
http:
paths:
Expand All @@ -25,10 +31,9 @@ spec:
name: caddy
port:
number: {{ CADDY_HTTP_PORT }}
{%- endfor %}
tls:
- hosts:
{%- for host in HOSTS if host is defined %}
- {{ host -}}
{% endfor %}
secretName: central-lb-ingress-tls
- {{ host }}
secretName: {{ host | replace(".", "-") }}-tls
{%- endfor %}

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# when installing additional plugins such as tutor-ecommerce or tutor-minio.
# The workaround is to manually add a list of hosts to be routed to the caddy
# instance.
"INGRESS_HOST_LIST": [],
"ADDITIONAL_INGRESS_HOST_LIST": [],
"ENABLE_SHARED_HARMONY_SEARCH": False,
},
"overrides": {
Expand Down