Skip to content

Commit

Permalink
remove zarf helm overrides, pt.3
Browse files Browse the repository at this point in the history
  • Loading branch information
justinthelaw committed Sep 27, 2024
1 parent b9c4791 commit baf0dff
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 36 deletions.
11 changes: 9 additions & 2 deletions chart/templates/core-dns-custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ metadata:
namespace: kube-system
data:
uds.override: |
{{ .Values.coreDnsDefaults | nindent 4 }}
{{ .Values.coreDnsOverrides | nindent 4 }}
rewrite stop {
name regex (.*\.admin\.uds\.dev) admin-ingressgateway.istio-admin-gateway.svc.cluster.local answer auto
}
rewrite stop {
name regex (.*\.uds\.dev) tenant-ingressgateway.istio-tenant-gateway.svc.cluster.local answer auto
}
rewrite stop {
name regex (.*\.uds\.dev) host.k3d.internal answer auto
}
10 changes: 0 additions & 10 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
extraPorts: []

coreDnsDefaults: |
rewrite {
name regex (.*\.admin\.uds\.dev) admin-ingressgateway.istio-admin-gateway.svc.cluster.local answer auto
}
rewrite {
name regex (.*\.uds\.dev) tenant-ingressgateway.istio-tenant-gateway.svc.cluster.local answer auto
}
coreDnsOverrides: ""
12 changes: 1 addition & 11 deletions docs/DNS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,10 @@ One of the core assumptions of the `uds-k3d` package is the use of `uds.dev` as

[UDS Core](https://github.com/defenseunicorns/uds-core) is assumed to be the main infrastructure and/or testing target in local development; therefore, the DNS resolution assumes the existence of the default admin and tenant Istio gateways.

This package includes a CoreDNS configuration override designed to rewrite requests for `*.uds.dev` to the tenant and admin Istio gateways based on the subdomain, `*.admin.uds.dev` or `*.uds.dev`. This rewrite ensures that any DNS resolution request within the cluster targeting a `*.uds.dev` address will be correctly routed to the correct service mesh gateway.
This package includes a CoreDNS configuration override designed to rewrite requests for `*.uds.dev` to the tenant and admin Istio gateways based on the subdomain, `*.admin.uds.dev` or `*.uds.dev`. This rewrite ensures that any DNS resolution request within the cluster targeting a `*.uds.dev` address will be correctly routed to the correct service mesh gateway. A final rewrite in this package is used as a catch-all by redirecting `*.uds.dev` requests to `host.k3d.internal`.

The outcome of this is a pods in the cluster can resolve domains like sso.uds.dev to an address (not 127.0.0.1) that will ultimately get routed correctly.

To add additional CoreDNS overrides, you can set the `coreDnsOverrides` value by supplying the following to the deployment command:

```bash
--set COREDNS_OVERRIDES="
rewrite {
name regex (.*\.uds\.dev) host.k3d.internal answer auto
}
"
```

## Nginx Configuration

Additionally, the package includes Nginx configuration that assumes the use of `uds.dev` as the base domain. This configuration is tailored to support the development environment setup, ensuring that Nginx correctly handles requests and routes them within the cluster, based on the `uds.dev` domain.
4 changes: 0 additions & 4 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ variables:
default: ""
- name: NGINX_EXTRA_PORTS
default: "[]"
- name: COREDNS_OVERRIDES
autoIndent: true
default: ""

tasks:
- name: default
Expand All @@ -24,7 +21,6 @@ tasks:
--set K3D_IMAGE=${IMAGE_NAME}:${VERSION} \
--set K3D_EXTRA_ARGS="${K3D_EXTRA_ARGS}" \
--set NGINX_EXTRA_PORTS="${NGINX_EXTRA_PORTS}" \
--set COREDNS_OVERRIDES="${COREDNS_OVERRIDES}" \
--no-progress --confirm
- name: validate
Expand Down
3 changes: 0 additions & 3 deletions values/dev-stack-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
extraPorts: ###ZARF_VAR_NGINX_EXTRA_PORTS###

coreDnsOverrides: |
###ZARF_VAR_COREDNS_OVERRIDES###
6 changes: 0 additions & 6 deletions zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ variables:
description: "Optionally allow more ports through Nginx (combine with K3D_EXTRA_ARGS '-p <port>:<port>@server:*')"
default: "[]"

- name: COREDNS_OVERRIDES
description: |
"CoreDNS rewrites beyond the default overrides for UDS Core"
autoIndent: true
default: ""

components:
- name: destroy-cluster
required: true
Expand Down

0 comments on commit baf0dff

Please sign in to comment.