Customize Domain and Configure DNS
This task explains how to customize your homelab cluster to use your own domain name instead of the default
peekoff.com and how to configure your Domain Name System (DNS) provider. This setup uses Cloudflare for DNS records.
Audience: Users deploying a new homelab cluster from this repository.
Prerequisites:
- A command-line environment with
rg(ripgrep) andsedinstalled. - An active Cloudflare account with a registered domain.
- A Cloudflare API Token with permissions to edit DNS records for your zone.
- Your Cloudflare DNS Zone ID, which is available on your domain's overview page in the Cloudflare dashboard.
Replace Hard-Coded Domain References
The repository uses the placeholder domain peekoff.com throughout its configuration files. This project uses
hard-coded domain references to simplify initial setup and avoid complex templating engines for this homelab context.
You must replace all instances with your custom domain.
To replace all occurrences of peekoff.com with your domain, navigate to the root of your local repository and execute
the following command. Replace your-domain.com with your actual domain name.
rg -l "peekoff.com" | xargs sed -i 's/peekoff\.se/your-domain.com/g'
This command uses ripgrep (rg) to locate files containing the string peekoff.com and then uses sed to perform an
in-place replacement.
domain you don't control, preventing them from functioning correctly. :::
Configure Cloudflare DNS
This homelab cluster requires Cloudflare for DNS records and TLS certificate management via Cert Manager.
This approach avoids storing secrets directly in Git repositories. :::
You must manually create DNS records in Cloudflare to point your domain to the cluster's external IP address.
Steps to configure the initial DNS record:
-
Obtain your cluster's external IP address. This is the public IP address assigned to the
cilium-gateway-externalservice in thegatewaynamespace. After runningtofu apply, you can find it by running:kubectl get svc -n gateway cilium-gateway-external -o jsonpath='{.status.loadBalancer.ingress[0].ip}' -
Create an
Arecord in Cloudflare. In your Cloudflare DNS dashboard, create anArecord for your root domain (@) and/or a wildcardArecord (*) pointing to the external IP address from the previous step.
Understand Tool Responsibilities
issues:
- OpenTofu: Provisions the virtual machines and installs the base Talos Kubernetes cluster. It doesn't manage the applications running inside the cluster.
- ArgoCD: Deploys and manages all Kubernetes applications using the YAML manifests stored in the
k8s/directory of this Git repository.
If you omit the domain replacement step before committing your changes, ArgoCD will deploy applications configured with
the default peekoff.com domain. This creates a state of drift, where the infrastructure provisioned by OpenTofu can
use your new domain, but the Kubernetes services will be unreachable because they're pointing to a domain you don't
control. :::
Example: Domain Change in a Kubernetes Manifest
To illustrate the effect of the domain replacement, observe the following change in the
k8s/applications/media/jellyfin/http-route.yaml file.
Before:
[...]
hostnames:
- 'film.peekoff.com'
[...]
After (with your-domain.com applied):
[...]
hostnames:
- 'film.your-domain.com'
[...]