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:
16
k8s/overlays/production/deployment-patch.yaml
Normal file
16
k8s/overlays/production/deployment-patch.yaml
Normal 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"
|
||||
28
k8s/overlays/production/kustomization.yaml
Normal file
28
k8s/overlays/production/kustomization.yaml
Normal 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
|
||||
7
k8s/overlays/production/namespace.yaml
Normal file
7
k8s/overlays/production/namespace.yaml
Normal 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
|
||||
12
k8s/overlays/production/secrets.example.yaml
Normal file
12
k8s/overlays/production/secrets.example.yaml
Normal 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"
|
||||
17
k8s/overlays/staging/deployment-patch.yaml
Normal file
17
k8s/overlays/staging/deployment-patch.yaml
Normal 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"
|
||||
24
k8s/overlays/staging/kustomization.yaml
Normal file
24
k8s/overlays/staging/kustomization.yaml
Normal 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
|
||||
7
k8s/overlays/staging/namespace.yaml
Normal file
7
k8s/overlays/staging/namespace.yaml
Normal 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
|
||||
8
k8s/overlays/staging/secrets.example.yaml
Normal file
8
k8s/overlays/staging/secrets.example.yaml
Normal 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"
|
||||
Reference in New Issue
Block a user