mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-24 10:02:23 +07:00
docs: update DNS tutorial
This commit is contained in:
parent
411ee69501
commit
208eaea59f
@ -50,6 +50,8 @@ Change the following parameters based on your hardware.
|
|||||||
|
|
||||||
## Update Ingresses to point to your domain
|
## 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:
|
My domain is `khuedoan.com`, run the following command to replace it with yours:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
@ -1,14 +1,40 @@
|
|||||||
# DNS setup
|
# 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
|
- Change the DNS config in your router
|
||||||
- Run your own DNS server in the cluster
|
- Change the DNS config at your domain registrar (doesn't work with the [`home.arpa`](https://datatracker.ietf.org/doc/html/rfc8375) domain)
|
||||||
- Change the DNS config in your domain registrar
|
|
||||||
|
|
||||||
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
|
```hcl
|
||||||
resource "cloudflare_record" "homelab_records" {
|
resource "cloudflare_record" "homelab_records" {
|
||||||
|
@ -23,21 +23,7 @@ make -C metal dev
|
|||||||
make bootstrap
|
make bootstrap
|
||||||
```
|
```
|
||||||
|
|
||||||
Get the Ingress addresses and IPs:
|
Finally follow the [DNS guide](./deployment/dns.md) to update your DNS setup (the easiest one is the `/etc/hosts` option)
|
||||||
|
|
||||||
```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.
|
|
||||||
```
|
|
||||||
|
|
||||||
## Clean up
|
## Clean up
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user