feat(radarr): add Kubernetes manifests and migration script for Radarr
Sync HTPC Manifests to GitOps / Sync Manifests to GitOps Repo (push) Successful in 4s
Sync HTPC Manifests to GitOps / Sync Manifests to GitOps Repo (push) Successful in 4s
This commit is contained in:
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
# ==============================================================================
|
||||
# Radarr Rollback Script: Kubernetes -> Host Standalone radarr.service
|
||||
# ==============================================================================
|
||||
set -euo pipefail
|
||||
|
||||
CLUSTER_HOST="10.2.0.4"
|
||||
SSH_USER="bart"
|
||||
HTPC_NS="htpc"
|
||||
|
||||
COLOR_GREEN="\033[0;32m"
|
||||
COLOR_YELLOW="\033[1;33m"
|
||||
COLOR_RED="\033[0;31m"
|
||||
COLOR_BLUE="\033[0;34m"
|
||||
COLOR_RESET="\033[0m"
|
||||
|
||||
log_info() { echo -e "${COLOR_GREEN}[INFO]${COLOR_RESET} $1"; }
|
||||
log_step() { echo -e "\n${COLOR_BLUE}==>${COLOR_RESET} ${COLOR_GREEN}$1${COLOR_RESET}"; }
|
||||
log_warn() { echo -e "${COLOR_YELLOW}[WARN]${COLOR_RESET} $1"; }
|
||||
|
||||
echo "========================================================================"
|
||||
echo " RADARR ROLLBACK NAAR STANDALONE SERVICE OP $CLUSTER_HOST"
|
||||
echo "========================================================================"
|
||||
read -p "Weet je zeker dat je wilt terugrollen naar standalone radarr? (j/N): " -r CONFIRM
|
||||
if [[ ! "$CONFIRM" =~ ^[jJyY]$ ]]; then
|
||||
log_info "Rollback geannuleerd."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
log_step "1. Kubernetes Radarr deployment schalen naar 0..."
|
||||
kubectl scale deployment/radarr -n "${HTPC_NS}" --replicas=0 || true
|
||||
|
||||
log_step "2. Standalone radarr.service inschakelen en starten op $CLUSTER_HOST..."
|
||||
ssh -t "${SSH_USER}@${CLUSTER_HOST}" "sudo systemctl enable --now radarr"
|
||||
|
||||
log_step "3. Status controleren..."
|
||||
sleep 3
|
||||
ssh -o BatchMode=yes "${SSH_USER}@${CLUSTER_HOST}" "systemctl status radarr --no-pager" | head -n 10
|
||||
ssh -o BatchMode=yes "${SSH_USER}@${CLUSTER_HOST}" "curl -I -s http://127.0.0.1:7878/radarr/ping" | head -n 1
|
||||
|
||||
log_info "Rollback voltooid. Standalone radarr is weer actief."
|
||||
Reference in New Issue
Block a user