GloriousFlywheel

OpenTofu Modules

All reusable infrastructure modules live in tofu/modules/. Each module is designed to be composed by stack root configurations in tofu/stacks/.

There are 15 modules organized by function: runner infrastructure, cache platform, Kubernetes primitives, and operators.

Runner Infrastructure

arc-controller

Deploys the GitHub Actions Runner Controller (ARC) via Helm chart. The controller watches for workflow_job webhook events and manages runner scale sets.

arc-runner

Deploys a GitHub Actions runner scale set via ARC. Supports docker, dind, and nix runner types with scale-to-zero.

gitlab-runner

Deploys a GitLab Runner via Helm chart with HPA support. Supports docker, dind, and nix runner types with configurable autoscaling, monitoring, and namespace-per-job isolation.

gitlab-user-runner

Registers a GitLab Runner via the gitlab_user_runner resource, automating token lifecycle management.

runner-dashboard

Deploys the SvelteKit runner dashboard with OAuth login, Prometheus metrics, multi-namespace RBAC, and optional Caddy sidecar proxy.

runner-cleanup

CronJob that reaps orphaned and stuck pods (Terminating, Completed, Failed) in the runner namespace.

runner-security

Applies security policies to the runner namespace: default-deny NetworkPolicy, ResourceQuota, LimitRange, and PriorityClasses.

gitlab-agent-rbac

Configures Kubernetes RBAC for GitLab Agent ci_access impersonation with read-only runner access.

Cache Platform

hpa-deployment

Generic HPA-enabled deployment module for stateless services with object storage backends. Used by the Attic cache API, and supports Ingress, TLS, Prometheus scraping, and topology spread.

bazel-cache

Deploys bazel-remote cache server with S3/MinIO backend. Supports HPA autoscaling, Ingress, and Prometheus metrics.

postgresql-cnpg

Production-grade PostgreSQL cluster using CloudNativePG with TLS, network policies, S3 backup, and high availability.

Operators

cnpg-operator

Installs the CloudNativePG operator via Helm chart for managing PostgreSQL cluster CRDs.

minio-operator

Installs the MinIO Operator via Helm chart for managing MinIO Tenant CRDs.

minio-tenant

Creates a MinIO Tenant CRD for S3-compatible object storage. Supports standalone and distributed HA modes with lifecycle policies.

DNS

dns-record

Reusable DNS record management supporting DreamHost API and external-dns annotation strategies.