infra_wiki

Cloud accounts

The Google Cloud projects, Cloudflare zones and Google Workspace domain that OpenTofu declares, and what each one is for.

The lab has three cloud accounts: a Google Cloud organization, a Cloudflare account and a Google Workspace domain. kthx, public DNS and cluster workload identity depend on them. OpenTofu declares all three, and Atlantis applies them from pull requests.

Google Cloud#

The organization root declares folders, projects, budgets, policies, custom roles and IAM. The Google providers of most roots impersonate the terraform service account in homelab-ng.

ProjectWhat it is for
homelab-ngIt has the OpenTofu state bucket, Firestore, and the oldboy VM. It also has the KMS key that unseals OpenBao, the Prowler cloud-scanner identity, the bucket and identity that back up the mate database, the SPIRE upload test bucket, and workload identity pools for GitHub Actions, Vercel, the clusters and SPIRE.
bluenoseIt has the storage, identities and Secret Manager of kthx. It is also the default Vessel, the project that kthx deploys Apps into.
trusted-buildsThe supply chain of kthx Apps. It has the signing key, the Binary Authorization attestor, a staging registry and the Developer Connect link to GitHub.
lolcorpHolds the org policies a Google Workspace BigQuery export needs. Nothing runs in it.
wishin-appThe Firebase project of wishin.app, a gift wishlist site.
jonpulsiferThe owner's jonpulsifer bucket and a dotfiles Cloud Source repository.

projects.tf also declares firebees, kubesec, secure-the-cloud and cloud-glue, which no documented app uses.

Cloudflare#

The Cloudflare root declares the zones, the Cloudflare Tunnels that Ingress and DNS describes, and the Pages projects of wiki.lolwtf.ca and oidc.lolwtf.ca.

ZoneWhat it is for
lolwtf.caLab hosts, cluster services and API servers, the wiki, and the cluster OIDC documents
lolwtf.devThe default zone for App names (KTHX_ENGINE_DOMAIN)
kthx.devkthx at the apex, and its quick sites at <name>.kthx.dev
clankerbanker.caclankerbanker
embarrassing.caApp names
pulsifer.capulsifer.ca on GitHub Pages, and mail on Google Workspace
wishin.appwishin.app on Vercel, and App names

Google Workspace#

The Workspace root declares the pulsifer.ca domain, its alias pulsifer.dev, the owner's user, a terraform user and an agent user. Its cloud@pulsifer.ca group holds Owner and the organization admin roles in Google Cloud. The group's members include the agent user and the terraform service account.

Rules#

  • Create a project in terraform/gcp/organization/projects.tf, or it has no folder, billing account or deletion lien. Then give it a root.
  • The organization blocks new service account keys. Give a workload a federated identity.
  • Keep a new App zone in step with the external-dns and cert-manager lists in Ingress and DNS, or its names do not resolve.

Where it lives#

  • terraform/gcp/organization/: the organization
  • terraform/gcp/projects/<project>/: the project roots
  • terraform/network/cloudflare/: the Cloudflare account
  • terraform/google-workspace/: Google Workspace

Edit on GitHub

↑↓ move ↵ open esc close