← All work
Infrastructure · 2025

Self-Hosted Trigger.dev on Kubernetes

Overview

A complete set of Kubernetes manifests for self-hosting the Trigger.dev background-job platform on a managed cluster. It wires together the web app, coordinator, queue, registry, and autoscaling node pools so the studio can run durable task orchestration on its own infrastructure rather than the hosted SaaS.

Why It Exists

Running Trigger.dev as a hosted service is convenient, but for cost control, data residency, and tight integration with internal tooling the studio needed a reproducible self-hosted deployment. This repo captures the working cluster topology so the platform can be re-deployed or recovered deterministically.

What We Built

A manifest-driven deployment covering every moving part of a Trigger.dev install: the webapp, coordinator, electric (Electric SQL sync), redis, the Kubernetes provider deployment that schedules task runs, an nginx-controller for ingress, a private registry with a documented failover path (registry-trigger-failover.yaml), and image-pull secrets. Capacity is handled through Karpenter primitives, a nodeClass plus multiple nodePool definitions, alongside ConfigMaps, application secrets, and a dedicated service account. A docker-compose.yml provides a parallel local/standalone bring-up.

Technologies & Approach

Pure declarative Kubernetes YAML, with Karpenter NodePools/NodeClass for just-in-time, right-sized node provisioning. Redis backs the queue, Electric SQL handles realtime sync, and an NGINX ingress controller fronts the web app. Secrets and configmaps externalize all environment-specific configuration.

Outcome / Impact

Delivered a working, re-deployable self-hosted Trigger.dev cluster that gives the studio full control over its task-orchestration backbone. Demonstrates the ability to take an off-the-shelf platform and operationalize it on Kubernetes with autoscaling and ingress.

Capabilities Demonstrated

  • Self-hosting third-party developer platforms on Kubernetes
  • Declarative cluster topology with autoscaling node pools (Karpenter)
  • Ingress, Redis, and private-registry operations
  • Secret and configuration management for multi-service deployments
More work See all →