chapter 1 · Building Arda
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
page 7 of 7 · read 0%

Jan 2026 · 11 min read · INFRASTRUCTURE · Field note

Running a Production-Like Platform on a Three-Node K3s Cluster

Setting up a resilient self-hosted lab: 3 control-plane/worker nodes, CloudNativePG HA PostgreSQL, NATS JetStream, Valkey, Traefik, Cloudflare Tunnel, and ArgoCD GitOps.

✎ arda-labs/arda-infra · #Arda Labs #K3s #Kubernetes #CloudNativePG #DevOps #GitOps #Homelab #Infrastructure

Problem Context

Testing distributed microservice patterns such as failover, rolling rollouts, outbox consumers, and ingress security on managed public Kubernetes can become expensive for independent research and development.

GitOps Deployment Pipeline (ArgoCD & K3s)
1. Git PushGitHub Repo2. GitHub ActionsBuild & Test Containers3. GHCR RegistryVersioned Image Tag4. ArgoCD GitOpsApp of Apps Sync5. 3-Node K3s Cluster (Production-like Self-Hosted Lab)Traefik Ingress · CloudNativePG · NATS JetStream · Zero-Downtime Rolling Updates

Running a Production-Like Platform on a Three-Node K3s Cluster

Architecture & Design

We constructed a production-like 3-node bare-metal K3s cluster (nodes 192.168.100.201-203) using embedded etcd for high availability. Ingress traffic enters via Cloudflare Tunnels (eliminating public IP exposure) into Traefik Ingress. State is managed by CloudNativePG (HA PostgreSQL with automatic leader election) and Valkey. Workload delivery is fully automated via declarative ArgoCD GitOps syncing manifests directly from GitHub.

Key Technical Decisions

  1. 1Embedded etcd High-Availability: 3 server nodes participate in quorum, allowing any single node to fail without cluster downtime.
  2. 2CloudNativePG PostgreSQL Operator: automated asynchronous streaming replication, continuous WAL archiving, and sub-10s failover.
  3. 3Cloudflare Tunnel Zero-Trust Ingress: all cluster endpoints are published securely without port forwarding or exposing router firewalls.
  4. 4ArgoCD App of Apps Pattern: single root GitOps application orchestrating infrastructure operators and microservice Helm releases.

Code & Configuration

CloudNativePG HA Cluster Definition (k8s/database/cluster.yaml) · yaml
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: arda-postgres-ha
  namespace: database
spec:
  instances: 3
  primaryUpdateStrategy: unsupervised
  storage:
    size: 20Gi
    storageClass: local-path
  postgresql:
    parameters:
      shared_buffers: "256MB"
      max_connections: "200"

Verified repository evidence

  • infrastructure · direct

    Orchestrated a 3-node bare-metal K3s cluster running CloudNativePG HA PostgreSQL, Valkey, Traefik, and Cloudflare Tunnels managed declaratively via ArgoCD.

    ↳ 3 control-plane/worker nodes with CloudNativePG PostgreSQL operator, Valkey caching, Traefik ingress controller, and Cloudflare Tunnel zero-trust exposure.

    arda-labs/arda-infra ↗
  • infrastructure · direct

    Built and operate a Proxmox-based K3s Homelab on one ThinkCentre host with three Ubuntu 26 VMs, Longhorn storage, Traefik ingress, and automated local CI/CD pipelines.

    ↳ One ThinkCentre host with Intel Xeon E-2286M (8 cores / 16 threads) and 32 GB RAM, running Proxmox with three Ubuntu 26 VMs. The guests run K3s, Longhorn storage, Traefik Ingress Controller, and automated container deployment pipelines.

    Self-Hosted Infrastructure Lab ↗

Key Engineering Takeaways

  • A 3-node K3s cluster provides identical API semantics to full Kubernetes while consuming less than 512MB RAM per control-plane node.
  • CloudNativePG delivers enterprise-grade database replication and automated failover out of the box.
  • Declarative GitOps guarantees that the entire infrastructure state is version-controlled and reproducible from scratch.