From 5986bb6cad1453fcc09f677922e18a27b7357933 Mon Sep 17 00:00:00 2001 From: Joel McCoy Date: Fri, 13 Dec 2024 14:33:51 -0600 Subject: [PATCH 1/4] feat: add ability to override nginx domain --- chart/templates/nginx.yaml | 4 ++-- chart/values.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chart/templates/nginx.yaml b/chart/templates/nginx.yaml index 36a3d27..4c3ac78 100644 --- a/chart/templates/nginx.yaml +++ b/chart/templates/nginx.yaml @@ -12,8 +12,8 @@ data: stream { map $ssl_preread_server_name $selected_upstream { hostnames; - *.admin.uds.dev backend_admin; - *.uds.dev backend_tenant; + *.admin.{{ .Values.domain }} backend_admin; + *.{{ .Values.domain }} backend_tenant; {{- if .Values.customGateway | default false}} *.{{ .Values.customGateway.domainName }} backend_custom_gateway; {{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index 27bc18f..4c3d919 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,5 +1,7 @@ extraPorts: [] +domain: uds.dev + coreDnsOverrides: | rewrite stop { name regex (.*\.admin\.uds\.dev) admin-ingressgateway.istio-admin-gateway.svc.cluster.local answer auto From 27e8c9ef2531dee400020905a9f18d6266f12b69 Mon Sep 17 00:00:00 2001 From: Joel McCoy Date: Tue, 17 Dec 2024 14:01:52 -0600 Subject: [PATCH 2/4] chore: add admin domain / set zarf variables --- chart/templates/nginx.yaml | 2 +- chart/values.yaml | 3 ++- zarf.yaml | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/chart/templates/nginx.yaml b/chart/templates/nginx.yaml index 4c3ac78..8e21985 100644 --- a/chart/templates/nginx.yaml +++ b/chart/templates/nginx.yaml @@ -12,7 +12,7 @@ data: stream { map $ssl_preread_server_name $selected_upstream { hostnames; - *.admin.{{ .Values.domain }} backend_admin; + *.{{ .Values.adminDomain }} backend_admin; *.{{ .Values.domain }} backend_tenant; {{- if .Values.customGateway | default false}} *.{{ .Values.customGateway.domainName }} backend_custom_gateway; diff --git a/chart/values.yaml b/chart/values.yaml index 4c3d919..5e278b4 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,6 +1,7 @@ extraPorts: [] -domain: uds.dev +domain: "###ZARF_VAR_DOMAIN###" +adminDomain: "###ZARF_VAR_ADMIN_DOMAIN###" coreDnsOverrides: | rewrite stop { diff --git a/zarf.yaml b/zarf.yaml index 35333b0..4f9ee2b 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -27,6 +27,13 @@ variables: description: "Optionally allow more ports through Nginx (combine with K3D_EXTRA_ARGS '-p :@server:*')" default: "[]" + - name: DOMAIN + description: "Cluster domain" + default: "uds.dev" + + - name: ADMIN_DOMAIN + description: "Domain for admin services, defaults to `admin.DOMAIN`" + components: - name: destroy-cluster required: true From ac3770423221ee8f23cb00319369b07ff4c7daa9 Mon Sep 17 00:00:00 2001 From: Joel McCoy Date: Tue, 17 Dec 2024 14:10:10 -0600 Subject: [PATCH 3/4] fix: set default admin domain --- chart/templates/nginx.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chart/templates/nginx.yaml b/chart/templates/nginx.yaml index 8e21985..8a90421 100644 --- a/chart/templates/nginx.yaml +++ b/chart/templates/nginx.yaml @@ -11,8 +11,12 @@ data: stream { map $ssl_preread_server_name $selected_upstream { - hostnames; + hostnames; + {{- if .Values.adminDomain }} *.{{ .Values.adminDomain }} backend_admin; + {{- else }} + *.admin.{{ .Values.domain }} backend_admin; + {{- end }} *.{{ .Values.domain }} backend_tenant; {{- if .Values.customGateway | default false}} *.{{ .Values.customGateway.domainName }} backend_custom_gateway; From 8528773756d0efce5299229422ac25168b0fac9b Mon Sep 17 00:00:00 2001 From: Joel McCoy Date: Tue, 17 Dec 2024 14:44:47 -0600 Subject: [PATCH 4/4] fix: set correct values file --- chart/values.yaml | 3 --- values/dev-stack-values.yaml | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chart/values.yaml b/chart/values.yaml index 5e278b4..27bc18f 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,8 +1,5 @@ extraPorts: [] -domain: "###ZARF_VAR_DOMAIN###" -adminDomain: "###ZARF_VAR_ADMIN_DOMAIN###" - coreDnsOverrides: | rewrite stop { name regex (.*\.admin\.uds\.dev) admin-ingressgateway.istio-admin-gateway.svc.cluster.local answer auto diff --git a/values/dev-stack-values.yaml b/values/dev-stack-values.yaml index a67e584..3082061 100644 --- a/values/dev-stack-values.yaml +++ b/values/dev-stack-values.yaml @@ -1 +1,4 @@ extraPorts: ###ZARF_VAR_NGINX_EXTRA_PORTS### + +domain: "###ZARF_VAR_DOMAIN###" +adminDomain: "###ZARF_VAR_ADMIN_DOMAIN###"