K8s – Namespace Manifests Backup (Bash)
Back up resource manifests from a Kubernetes namespace.
#!/usr/bin/env bash
NS="${1:-default}"
DIR="k8s-backup-$NS-$(date +%F)"
mkdir -p "$DIR"
kubectl -n "$NS" get all,cm,secret,sa,ing,netpol -o yaml > "$DIR/$NS.yaml"
From Joseph Nakhle's automation workbench.
More Other tools scripts