diff --git a/README.md b/README.md index a1d60fc..80b5c7e 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,7 @@ package: Configure MinIO: - [Configuring Minio](docs/MINIO.md) + +### DNS Assumptions: + +- [DNS Assumptions](docs/DNS.md) diff --git a/chart/templates/core-dns-custom.yaml b/chart/templates/core-dns-custom.yaml new file mode 100644 index 0000000..b813b1a --- /dev/null +++ b/chart/templates/core-dns-custom.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: coredns-custom + namespace: kube-system +data: + uds.override: | + rewrite name regex (.*\.uds\.dev) host.k3d.internal diff --git a/docs/DNS.md b/docs/DNS.md new file mode 100644 index 0000000..d9a0ed0 --- /dev/null +++ b/docs/DNS.md @@ -0,0 +1,13 @@ +## Domain Assumptions + +One of the core assumptions of the `uds-k3d` package is the use of `uds.dev` as the base domain for your development environment. This assumption is integral to the DNS and network configuration provided by the package. It is based on an existing DNS entry for `*.uds.dev` that resolves to `127.0.0.1`, facilitating local development and testing. + +### CoreDNS Override + +The package includes a CoreDNS configuration override designed to rewrite requests for `*.uds.dev` to `host.k3d.internal`. This rewrite ensures that any DNS resolution request within the cluster targeting a `*.uds.dev` address will be correctly routed to `host.k3d.internal` which is an internal K3D alias which resolves to the host gateway. + +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. + +### 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. \ No newline at end of file diff --git a/zarf.yaml b/zarf.yaml index 00e43e0..d132843 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -73,6 +73,9 @@ components: description: "Load network ip base for MetalLB" setVariables: - name: BASE_IP + after: + - cmd: ./zarf tools kubectl rollout restart deployment coredns -n kube-system + description: "Restart CoreDNS to pick up internal DNS override for uds.dev" charts: - name: metallb namespace: uds-dev-stack