Add Kubernetes/K3s deployment manifests and documentation

- Complete k8s manifests with Kustomize support
- Production and staging overlays
- ConfigMap/Secret management
- Ingress with TLS (Traefik/NGINX)
- Persistent storage for SQLite
- Comprehensive k8s README with operations guide
- Updated main README with k8s deployment instructions
- Gitignore for k8s secrets

Usage:
  kubectl apply -k k8s/overlays/production
This commit is contained in:
2026-02-01 16:40:16 -05:00
parent 2470f121e2
commit f3f1c0a0c8
16 changed files with 692 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: dyn-ddns
spec:
template:
spec:
containers:
- name: dyn-ddns
resources:
requests:
memory: "128Mi"
cpu: "200m"
limits:
memory: "512Mi"
cpu: "1000m"

View File

@@ -0,0 +1,28 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- ../../base
- secrets.yaml
namePrefix: prod-
namespace: dyn-ddns
commonLabels:
environment: production
configMapGenerator:
- name: dyn-ddns-config
behavior: merge
literals:
- TECHNITIUM_URL=https://dns.dws.rip
- RATE_LIMIT_PER_IP=10
- RATE_LIMIT_PER_TOKEN=1
patchesStrategicMerge:
- deployment-patch.yaml
replicas:
- name: dyn-ddns
count: 2

View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: dyn-ddns
labels:
app.kubernetes.io/name: dyn-ddns
app.kubernetes.io/part-of: dws-dns

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: dyn-ddns-secrets
type: Opaque
stringData:
# Replace with your actual Technitium API token
TECHNITIUM_TOKEN: "your-production-api-token-here"
# Or use username/password (not recommended for production)
# TECHNITIUM_USERNAME: "admin"
# TECHNITIUM_PASSWORD: "your-password"

View File

@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: dyn-ddns
spec:
replicas: 1
template:
spec:
containers:
- name: dyn-ddns
resources:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "500m"

View File

@@ -0,0 +1,24 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- ../../base
- secrets.yaml
namePrefix: staging-
namespace: dyn-ddns-staging
commonLabels:
environment: staging
configMapGenerator:
- name: dyn-ddns-config
behavior: merge
literals:
- TECHNITIUM_URL=https://dns-staging.dws.rip
- RATE_LIMIT_PER_IP=100
- RATE_LIMIT_PER_TOKEN=10
patchesStrategicMerge:
- deployment-patch.yaml

View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: dyn-ddns-staging
labels:
app.kubernetes.io/name: dyn-ddns
app.kubernetes.io/part-of: dws-dns

View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: dyn-ddns-secrets
type: Opaque
stringData:
# Replace with your staging Technitium credentials
TECHNITIUM_TOKEN: "your-staging-api-token-here"