Overview

K3s is a lightweight Kubernetes distribution perfect for single-node deployments that may scale to multi-node clusters.
Advanced: Requires Kubernetes expertise. Only use if planning for multi-server scaling or need enterprise features.

Why K3s?

  • ✅ Production-grade orchestration
  • ✅ Auto-scaling capabilities
  • ✅ Standard K8s manifests
  • ✅ Easy to scale later
  • ❌ Steep learning curve
  • ❌ ~1GB RAM overhead

Quick Start

1. Install K3s

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

# Verify
kubectl get nodes

2. Create Namespace

kubectl create namespace ripplecore

3. Deploy PostgreSQL

postgres-deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres
  namespace: ripplecore
spec:
  replicas: 1
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
    spec:
      containers:
      - name: postgres
        image: postgres:18-alpine
        env:
        - name: POSTGRES_DB
          value: ripplecore
        - name: POSTGRES_USER
          value: ripplecore
        - name: POSTGRES_PASSWORD
          valueFrom:
            secretKeyRef:
              name: postgres-secret
              key: password
        volumeMounts:
        - mountPath: /var/lib/postgresql/data
          name: postgres-storage
      volumes:
      - name: postgres-storage
        persistentVolumeClaim:
          claimName: postgres-pvc
---
apiVersion: v1
kind: Service
metadata:
  name: postgres
  namespace: ripplecore
spec:
  ports:
  - port: 5432
  selector:
    app: postgres

4. Deploy App

app-deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app
  namespace: ripplecore
spec:
  replicas: 2
  selector:
    matchLabels:
      app: ripplecore-app
  template:
    metadata:
      labels:
        app: ripplecore-app
    spec:
      containers:
      - name: app
        image: your-registry/ripplecore-app:latest
        ports:
        - containerPort: 3000
        env:
        - name: DATABASE_URL
          valueFrom:
            secretKeyRef:
              name: app-secrets
              key: database-url
        - name: NODE_ENV
          value: "production"
        livenessProbe:
          httpGet:
            path: /api/health
            port: 3000
          initialDelaySeconds: 30
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: app-service
  namespace: ripplecore
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 3000
  selector:
    app: ripplecore-app

5. Apply Manifests

kubectl apply -f postgres-deployment.yaml
kubectl apply -f app-deployment.yaml

# Check status
kubectl get pods -n ripplecore
Create ripplecore/Chart.yaml:
apiVersion: v2
name: ripplecore
version: 1.0.0
Deploy:
helm install ripplecore ./ripplecore -n ripplecore

Scaling

# Scale app to 3 replicas
kubectl scale deployment/app --replicas=3 -n ripplecore

# Auto-scaling
kubectl autoscale deployment app --cpu-percent=70 --min=2 --max=10 -n ripplecore

Monitoring

# Install metrics server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

# View resource usage
kubectl top pods -n ripplecore
kubectl top nodes

Pros & Cons

Pros:
  • ✅ Enterprise-grade
  • ✅ Auto-scaling
  • ✅ Self-healing
  • ✅ Easy multi-node
Cons:
  • ❌ Complex setup
  • ❌ High overhead
  • ❌ Overkill for single server
When to Use: Planning multi-server scaling or need enterprise orchestration. Migration from Dokploy: 8-12 hours
Only choose K3s if you need enterprise features or plan to scale to multiple nodes.