k8s: add base namespace and pod disruption budgets

- Namespace setup script with PSP/RBAC
- PodDisruptionBudgets for all services (zero-downtime drain)
This commit is contained in:
Story Crater Bot
2026-07-11 19:16:50 -07:00
parent 11898733e8
commit 11c26f3f29
2 changed files with 341 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
# Reusable namespace setup script
# Creates namespace and applies pod-security policy labels
# Usage: bash k8s/base/namespace-setup.sh <namespace> [<namespace2> ...]
set -euo pipefail
if [ $# -eq 0 ]; then
echo "Usage: $0 <namespace> [<namespace2> ...]" >&2
exit 1
fi
for namespace in "$@"; do
kubectl create namespace "$namespace" --dry-run=client -o yaml | kubectl apply -f -
kubectl label namespace "$namespace" \
pod-security.kubernetes.io/enforce=privileged \
pod-security.kubernetes.io/enforce-version=latest \
--overwrite
echo "✓ Namespace '$namespace' ready"
done