Kubernetes Deployment

Deploy Auto Commerce on Kubernetes for horizontal scaling, high availability, and production-grade infrastructure.

Why Kubernetes?

Kubernetes is recommended when you need:

  • Auto-scaling — Handle traffic spikes automatically
  • High availability — Zero downtime with rolling deployments
  • Resource efficiency — Run multiple services on shared infrastructure
  • Easy rollbacks — Quickly revert to previous versions

Deployment Options

Option Cost Best For
Raspberry Pi 5 + k3s ~$60 one-time Development, staging, learning
Cloud Kubernetes (DO, AWS, GKE) $80-200/month Production, enterprise

Prerequisites

  • Docker installed locally (for building images)
  • kubectl CLI tool
  • Access to a container registry (GHCR, Docker Hub)

Services

Auto Commerce on Kubernetes runs these services:

  • API — Laravel Octane (FrankenPHP) application (scalable)
  • Nginx — Reverse proxy for the API
  • Frontend — Next.js application (scalable)
  • Horizon — Laravel queue worker for background jobs
  • Reverb — WebSocket server for real-time events
  • Redis — Caching, sessions, and queues
  • Postgres — runs in-cluster via CloudNativePG (1 primary + 2 streaming replicas; serves autocom-db-rw for writes and autocom-db-ro for reads)

You can also point at an external managed Postgres (Neon, Supabase, RDS, Cloud SQL) if you prefer — set DB_HOST / DB_READ_HOST in the ConfigMap and skip the CNPG cluster.

Quick Start

# Install k3s
curl -sfL https://get.k3s.io | sh -

# Create namespace and apply manifests
sudo k3s kubectl create namespace autocom
kubectl apply -k k8s/overlays/default

Next Steps