homelab/k3s/nats/nats.yaml
Samantha Atkins 759ef949bc K3s cluster on Proxmox with WireGuard mesh networking
Replaced Headscale (too buggy in 0.28.x — random node drops) with direct
WireGuard hub-and-spoke + full mesh. 7 Proxmox VMs across 3 hosts form a
K3s v1.34.6 cluster: 3 control-plane/etcd nodes, 4 workers.

Running services: postgres, mariadb, ghost (x3), forgejo, authentik.
All unpinned services use local-path StorageClass. Databases pinned to
pve-worker and adder-worker with local PVs.

Includes VM provisioning scripts (create-debian-template.sh, clone-vm.sh),
K3s manifests for all services, and full deployment docs in k3s/README.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 01:23:13 -04:00

101 lines
1.8 KiB
YAML

# NATS — JetStream-enabled message broker
# JetStream enabled with persistent storage via local-path PVC
# Unpinned — scheduler places freely
# NodePorts: 32376 (client), 32377 (websocket), 32378 (monitoring)
#
# Deploy:
# kubectl apply -f nats.yaml -n <ns>
#
# Internal cluster DNS: nats:4222
# WebSocket: nats:8080
# Monitoring: nats:8222
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nats-config
data:
nats.conf: |
jetstream {
store_dir: /data
}
http_port: 8222
websocket {
port: 8080
no_tls: true
}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nats-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nats
spec:
replicas: 1
selector:
matchLabels:
app: nats
template:
metadata:
labels:
app: nats
spec:
containers:
- name: nats
image: nats:latest
command: ["-c", "/etc/nats/nats.conf"]
ports:
- containerPort: 4222
- containerPort: 8080
- containerPort: 8222
volumeMounts:
- name: nats-config
mountPath: /etc/nats
- name: nats-data
mountPath: /data
volumes:
- name: nats-config
configMap:
name: nats-config
- name: nats-data
persistentVolumeClaim:
claimName: nats-pvc
---
apiVersion: v1
kind: Service
metadata:
name: nats
spec:
selector:
app: nats
ports:
- name: client
port: 4222
targetPort: 4222
nodePort: 32376
- name: websocket
port: 8080
targetPort: 8080
nodePort: 32377
- name: monitoring
port: 8222
targetPort: 8222
nodePort: 32378
type: NodePort