From 208eaea59f1db648f016a0cffadeda2849cd8a76 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sun, 28 Nov 2021 23:20:31 +0700 Subject: [PATCH] docs: update DNS tutorial --- docs/src/deployment/configuration.md | 2 ++ docs/src/deployment/dns.md | 36 ++++++++++++++++++++++++---- docs/src/try_on_a_vm.md | 16 +------------ 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/docs/src/deployment/configuration.md b/docs/src/deployment/configuration.md index 1522c43e..a19af047 100644 --- a/docs/src/deployment/configuration.md +++ b/docs/src/deployment/configuration.md @@ -50,6 +50,8 @@ Change the following parameters based on your hardware. ## Update Ingresses to point to your domain +> Use [`home.arpa`](https://datatracker.ietf.org/doc/html/rfc8375) if you don't have a domain + My domain is `khuedoan.com`, run the following command to replace it with yours: ```sh diff --git a/docs/src/deployment/dns.md b/docs/src/deployment/dns.md index 2bf95719..3bcfbcaa 100644 --- a/docs/src/deployment/dns.md +++ b/docs/src/deployment/dns.md @@ -1,14 +1,40 @@ # DNS setup -Because everyone DNS setup is different, DNS automation is not in the scope of the project. +Because everyone DNS setup are different, DNS automation is not in the scope of the project. -Some options for DNS config: +Some options for DNS config (choose one): +- Update the `/etc/hosts` file (suitable for a test environment) - Change the DNS config in your router -- Run your own DNS server in the cluster -- Change the DNS config in your domain registrar +- Change the DNS config at your domain registrar (doesn't work with the [`home.arpa`](https://datatracker.ietf.org/doc/html/rfc8375) domain) -For example here is my set up using the third option with Cloudflare, automated using Terraform: +Before continuing to the next section for some examples, run this command to get a list of subdomain and its address: + +```sh +./scripts/get-dns-config +``` + +## Update `/etc/hosts` + +You paste the output from the command above directly to your `/etc/hosts` file like this: + +``` +# Static table lookup for hostnames. +# See hosts(5) for details. + +192.168.1.150 argocd.mydomain.com +192.168.1.150 git.mydomain.com +192.168.1.150 jellyfin.mydomain.com +# etc. +``` + +## In your router + +You can add each subdomain one by one like the previous method, or use a wildcard `*.mydomain.com` and point it to the IP address of the load blancer (from the output of the previous command) + +## At your domain registrar + +For example here is my set up for Cloudflare, automated using Terraform: ```hcl resource "cloudflare_record" "homelab_records" { diff --git a/docs/src/try_on_a_vm.md b/docs/src/try_on_a_vm.md index 0dfe8613..7b9c94e9 100644 --- a/docs/src/try_on_a_vm.md +++ b/docs/src/try_on_a_vm.md @@ -23,21 +23,7 @@ make -C metal dev make bootstrap ``` -Get the Ingress addresses and IPs: - -```sh -export KUBECONFIG=$PWD/metal/kubeconfig.yaml -kubectl get ingress -A -``` - -Then update your `/etc/hosts` or your router DNS config based on the output: - -``` -192.168.1.150 argocd.mydomain.com -192.168.1.150 git.mydomain.com -192.168.1.150 jellyfin.mydomain.com -# etc. -``` +Finally follow the [DNS guide](./deployment/dns.md) to update your DNS setup (the easiest one is the `/etc/hosts` option) ## Clean up