khuedoan-homelab/docs/installation/production/external-resources.md
Khue Doan 1405fadf1a refactor(docs): apply the Diátaxis framework
Squashed commit of the following:

commit 257867f196376df55fa0f57edbdf33967b1da04e
Author: Khue Doan <mail@khuedoan.com>
Date:   Sun Sep 18 16:45:42 2022 +0700

    refactor(docs): apply the Diátaxis framework
2022-09-19 02:40:07 +07:00

4.7 KiB

External resources

!!! info

These resources are optional, the homelab still works without them but will lack some features like trusted certificates and offsite backup

Although I try to keep the amount of external resources to the minimum, there's still need for a few of them. Below is a list of external resources and why we need them (also see some alternatives below).

Provider Resource Purpose
Terraform Cloud Workspace Terraform state backend
Cloudflare DNS DNS and DNS-01 challenge for certificates
Cloudflare Tunnel Public services to the internet without port forwarding
ZeroTier Virtual network Use as VPN to access home network from anywhere (with UDP hole punching)

Create credentials

You'll be asked to provide these credentials on first build.

Create Terraform workspace

Terraform is stateful, which means it needs somewhere to store its state. Terraform Cloud is one option for a state backend with a generous free tier, perfect for a homelab.

  1. Sign up for a Terraform Cloud account
  2. Create a workspace named homelab-external, this is the workspace where your homelab state will be stored.
  3. Change the "Execution Mode" from "Remote" to "Local". This will ensure your local machine, which can access your lab, is the one executing the terraform plan rather than the cloud runners.

If you decide to use a different Terraform backend, you'll need to edit the external/versions.tf file as required.

Cloudflare

ZeroTier

Alternatives

To avoid vendor lock-in, each external provider must have an equivalent alternative that is easy to replace:

  • Terraform Cloud:
  • Cloudflare DNS:
  • Cloudflare Tunnel:
    • Use port forwarding if it's available
    • Create a small VPS in the cloud and utilize Wireguard and HAProxy to route traffic via it
    • Access everything via VPN
    • See also awesome tunneling
  • ZeroTier virtual network: