Ana içeriğe geç

Cluster & GitOps Delivery

To host the Borrowd platform and my self-hosted engineering services, I built my infrastructure around a dedicated single-node k3s Kubernetes cluster. My goal was to leverage the declarative power of Kubernetes while keeping the physical overhead as low as possible. From bare metal provisioning to workload deployments, I rely entirely on GitOps.

This approach gives me a reproducible, self-healing environment where Git is the absolute single source of truth.


Physical Infrastructure: Single-Node k3s​

I chose k3s — Rancher's lightweight Kubernetes distribution — to avoid the heavy memory and CPU overhead of a traditional multi-master control plane.

Why this setup works for me
  • Zero Network Latency: Running workloads on a single physical host eliminates cross-node overlay network latency between my Ktor server, Postgres, and MinIO pods.
  • Direct Disk Speed: Using OpenEBS Hostpath LocalPV for persistent volume claims grants my database and object storage pods raw hostpath performance without complex distributed storage overhead.
  • Minimal RAM footprint: k3s packages control plane components into a single process using SQLite instead of etcd.

Declarative Deployment via GitOps​

Once the bare metal k3s host is up, everything else is managed declaratively using ArgoCD. I never run manual kubectl apply commands in production.

# Example Application Definition
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: borrowd-backend
spec:
project: default
source:
repoURL: 'https://git.dslan.at/dslan/argo-cd-apps.git'
path: borrowd-app/backend
targetRevision: HEAD
destination:
server: 'https://kubernetes.default.svc'
namespace: borrowd

My pipeline relies on two primary repositories: borrowd/app (Manifests) and argo-cd-apps (Cluster Apps).

Automated Drift Detection

ArgoCD continuously monitors the desired state in Git against my live cluster state. If drift occurs, ArgoCD automatically self-heals back to Git truth. If I need to rebuild the cluster from scratch, it takes minutes: I simply point ArgoCD at the argo-cd-apps repository, and it reconciles all namespaces, databases, ingress routes, and platform services.