Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.
toot-communityPublic archive

About

Platform code for the toot.community Mastodon instance

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

toot.community platform (archived)

Important

This repository is an archive. toot.community ran from November 2022 until 28 October 2026 and has closed. The Kubernetes cluster described here is being decommissioned in the week after the closure. Nothing in this repository is maintained any more, and the code is not meant to be run as-is: it is the infrastructure code and Kubernetes manifests of one specific production cluster, kept public as a reference.

What this was

toot.community was a general-purpose Mastodon instance that served up to roughly 35,000 users at its peak. This repository holds the complete infrastructure-as-code for the Kubernetes platform it ran on, managed end-to-end by one person (Jorijn Schrijvershof), with Mijndert Stuij contributing in the early days.

The cluster also hosted a few workloads unrelated to Mastodon (a Nextcloud trial deployment, n8n, a bridge service, GitHub Actions runners). They are left in place; the repository reflects the cluster as it actually ran, not a tidied-up demo.

The git history starts in July 2025, when the repository was made public. Earlier history (2022–2025: DigitalOcean, the move to Hetzner Cloud, the Cloudflare → Fastly → Cloudflare CDN changes) is not included.

Architecture

  • Hosting: Hetzner — control plane on Hetzner Cloud VMs, workers on bare-metal dedicated servers (migrated from cloud VMs in October 2025, see PR #432). Nodes are joined over KubeSpan (WireGuard).
  • OS: Talos Linux, custom image built with Packer, host firewall rendered from platform/talos/patches/. IPv6 dual-stack pod networking.
  • Provisioning: OpenTofu (platform/), driven by Taskfile.yml.
  • GitOps: Argo CD deploys everything under manifests/applications/ from this repository. Dependency updates are automated with Renovate.
  • Networking: Cilium (with Hubble), ingress-nginx / Traefik, Gateway API, cert-manager (Hetzner DNS webhook), cloudflared tunnels.
  • Data: PostgreSQL via CloudNativePG (Barman Cloud backups to object storage), Redis HA behind HAProxy, Elasticsearch via ECK, Longhorn and local-path storage.
  • Secrets: HashiCorp Vault with the Vault Secrets Operator (migrated from 1Password Connect in April 2026).
  • Access: Teleport (app discovery, JWT auth for internal tools), Dex.
  • Observability: VictoriaMetrics, VictoriaLogs (Vector), VictoriaTraces, Grafana, Alertmanager, Robusta/Holmes.
  • Protection: CrowdSec bouncers in Traefik and Varnish, Talos host firewall.
  • Scaling: KEDA, Vertical Pod Autoscaler, descheduler; see docs/puma-scaling.md and docs/sidekiq-scaling.md.
  • Mastodon: custom Helm chart in charts/mastodon (Varnish cache layer was removed in July 2026).

Repository layout

  • platform/ — OpenTofu code for Hetzner Cloud resources, Talos machine configs and firewall patches, Vault identities.
  • packer/ — Talos Linux image build.
  • manifests/cluster-bootstrap/ — Kustomize bootstrap of Argo CD and core services.
  • manifests/applications/ — one directory per application, deployed by Argo CD.
  • charts/ — custom Helm charts (Mastodon, Cloudflare tunnel, VPA resources).
  • docs/rca/ — post-incident reviews written for this cluster.
  • docs/runbooks/ — operational runbooks.
  • scripts/ — maintenance scripts (upgrades, media healing, CrowdSec bans).

Original setup notes

Kept for reference; they assume a live Hetzner project and a 1Password vault that no longer exist.

Create the template

Build a custom Talos Linux image for Hetzner Cloud using Packer:

cd packer
packer build .

Note the image ID from the output and update it in configs/production.tfvars

Create infrastructure

Install OpenTofu first, then provision the Hetzner Cloud infrastructure:

cd platform
task plan    # Review planned changes
task apply   # Deploy infrastructure

This creates the Kubernetes cluster, networking, storage, and security groups as defined in the OpenTofu configuration files.

Bootstrap

After infrastructure deployment, bootstrap the cluster with essential services:

cd platform
task get-kubeconfig   # Download cluster access credentials
task get-talosconfig  # Download Talos management credentials
cd ../

# Setup Hetzner Cloud integration
kubectl create --namespace kube-system secret generic hcloud \
  --from-literal=network="$(op read 'op://toot.community/6r6v2bqh6dhuunbn6nri4bw3sa/network')" \
  --from-literal=token="$(op read 'op://toot.community/6r6v2bqh6dhuunbn6nri4bw3sa/token')" \
  --from-literal=robot-user="$(op read 'op://toot.community/6r6v2bqh6dhuunbn6nri4bw3sa/robot-user')" \
  --from-literal=robot-password="$(op read 'op://toot.community/6r6v2bqh6dhuunbn6nri4bw3sa/robot-password')"

# Deploy core cluster services via ArgoCD
kustomize build --enable-helm --load-restrictor=LoadRestrictionsNone manifests/cluster-bootstrap | kubectl apply -f -

This bootstrap process installs:

  • ArgoCD for GitOps deployments
  • Core networking (Cilium)
  • Other essential cluster services defined in the manifests

About

Platform code for the toot.community Mastodon instance

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages