π The Upgrade Paradox: Achieving High Availability on a Stateful Single-Leader System
In modern 24/7 global enterprise operations, Continuous Integration and Continuous Delivery platforms cannot afford weekend maintenance windows or unplanned downtime. However, the Jenkins Controller architecture presents a fundamental engineering paradox: Jenkins is an active single-leader stateful daemon. Because the master maintains in-memory build execution graphs (Pipeline CPS FlowNodes), active thread monitors, and an exclusive file lock on $JENKINS_HOME, running multiple active-active read/write masters against the same filesystem leads to immediate file corruption and split-brain race conditions. Furthermore, upgrading plugins or core WAR versions dynamically in-place risks classloader conflicts and JVM crashes. Achieving Zero-Downtime Upgrades and High Availability (HA) requires specialized control-plane orchestration: implementing the Quiet Down draining protocol (/quietDown), immutable container-driven plugin pinning, and Active-Standby Blue-Green Controller Switching with atomic shared volume unmounting.
ENTERPRISE ACTIVE-STANDBY CONTROLLER ORCHESTRATION TOPOGRAPHY:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REVERSE PROXY / INGRESS ROUTER (Nginx / AWS ALB) β
β Endpoint: https://jenkins.company.com β
βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββ΄βββββββββββββββββββββββββ
β Active Route (100% Traffic) β Passive Standby (Health Check Only)
βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββββββββββββ
β PRIMARY CONTROLLER (CONTROLLER A - BLUE) β β RECOVERY CONTROLLER (CONTROLLER B - GREEN) β
β Active Version: LTS 2.440.2 β β Target Upgrade Version: LTS 2.440.3 β
β State: ACTIVE (Serving builds & webhooks) β β State: STANDBY / DRAINING β
β β β β
β β’ Holds Exclusive Filesystem Lock β β β’ JVM Idle or running pre-warmed container β
β β’ Manages active worker remoting connections β β β’ Ready to acquire volume mount upon failoverβ
βββββββββββββββββββββββββ¬βββββββββββββββββββββββ βββββββββββββββββββββββββ¬βββββββββββββββββββββββ
β β
β Read/Write Exclusive Access β Read-Only Standby / Hot Mount
βΌ βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SHARED ENTERPRISE STORAGE SUBSYSTEM β
β β
β Technologies: AWS EBS Multi-Attach (ReadWriteOnce) / Ceph RBD / NetApp Trident β
β Path: /var/lib/jenkins ($JENKINS_HOME) β
β Data: config.xml, secrets/, users/, jobs/*/builds/ β
β β
β CRITICAL INVARIANT: Only ONE controller process may hold Read/Write mounts! β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
THE QUIET DOWN DRAINING PROTOCOL STATE TRANSITIONS:
[Normal Operating State]
Controller accepts webhooks, schedules builds, executes agent steps.
β
β Admin / CI Automation invokes: POST /quietDown
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STATE: QUIET DOWN (PREPARING FOR SHUTDOWN) β
β β
β 1. Ingress Rejection of New Work: β
β β’ Jenkins web UI displays: "Jenkins is going to shut down" β
β β’ New pipeline triggers via Webhook or Timer are placed in QUEUE (Not started!) β
β β
β 2. In-Flight Workload Execution: β
β β’ Active pipelines (e.g. Build #104 running tests on an agent) CONTINUE UNIMPEDED! β
β β’ Controller waits until active executors reach ZERO: β
β jenkins.model.Jenkins.instance.overallLoad.totalExecutors == 0 β
β β
β 3. Timeout Boundary Enforcement: β
β β’ If short jobs finish in 3 minutes β Proceed immediately to restart β
β β’ If a long 2-hour job is running β SRE can cancel, let finish, or pause flow β
ββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββ
β
β All Executors Reach 0
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STATE: SAFE RESTART / VOLUME DETACH β
β β’ JVM process terminates cleanly (SIGTERM / systemctl stop jenkins) β
β β’ In-memory FlowNodes flushed to disk; zero corrupted XML files β
β β’ Storage volume unmounted cleanly; ready for upgrade container boot! β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
#!/usr/bin/env bash
# ==============================================================================
# Script: graceful_draining.sh
# Purpose: Puts Jenkins into Quiet Down mode, waits for in-flight builds to drain,
# and signals readiness for zero-downtime maintenance.
# ==============================================================================
set -euo pipefail
JENKINS_URL="https://jenkins.company.com"
ADMIN_USER="admin_lead"
API_TOKEN="11a8f3b21c4e90d782194b1234567890ab"
MAX_WAIT_SECONDS=600 # 10 Minutes timeout ceiling
POLL_INTERVAL=10
echo "[*] Step 1: Enabling Quiet Down mode on ${JENKINS_URL}..."
# Invocations to /quietDown require a POST request authenticated via API token
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
-u "${ADMIN_USER}:${API_TOKEN}" \
-X POST "${JENKINS_URL}/quietDown")
if [ "${HTTP_STATUS}" -ne 200 ] && [ "${HTTP_STATUS}" -ne 302 ]; then
echo "[β] FATAL: Failed to initiate Quiet Down mode. HTTP Status: ${HTTP_STATUS}"
exit 1
fi
echo "[β] Controller successfully placed in Quiet Down state. No new builds will start."
echo "[*] Step 2: Polling active executor count until cluster is fully drained..."
ELAPSED=0
while [ "${ELAPSED}" -lt "${MAX_WAIT_SECONDS}" ]; do
# Query overall active executor count via Jenkins JSON API
METRICS_PAYLOAD=$(curl -s -u "${ADMIN_USER}:${API_TOKEN}" "${JENKINS_URL}/api/json")
# Extract total number of busy executors across master and all agents
BUSY_EXECUTORS=$(echo "${METRICS_PAYLOAD}" | jq -r '.overallLoad.totalExecutors - .overallLoad.idleExecutors')
QUEUE_LENGTH=$(echo "${METRICS_PAYLOAD}" | jq -r '.queue.items | length')
echo "[+] Elapsed: ${ELAPSED}s | Busy Executors: ${BUSY_EXECUTORS} | Queued Items: ${QUEUE_LENGTH}"
if [ "${BUSY_EXECUTORS}" -le 0 ]; then
echo "[β] DRAIN COMPLETE: Zero active builds running. Controller safe for upgrade!"
exit 0
fi
sleep "${POLL_INTERVAL}"
ELAPSED=$((ELAPSED + POLL_INTERVAL))
done
echo "[!] WARNING: Drain timeout reached (${MAX_WAIT_SECONDS}s). Active jobs still running."
echo "[!] Cancelling Quiet Down mode to restore operations..."
curl -s -u "${ADMIN_USER}:${API_TOKEN}" -X POST "${JENKINS_URL}/cancelQuietDown"
exit 1
# ==============================================================================
# ENTERPRISE IMMUTABLE JENKINS CONTROLLER DOCKERFILE
# Guarantees identical plugin versions across Dev, Staging, and Production
# ==============================================================================
FROM jenkins/jenkins:2.440.3-lts-jdk17
# 1. Disable the Web GUI Setup Wizard completely
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"
# 2. Copy deterministic, pinned plugins manifest into the image
COPY --chown=jenkins:jenkins plugins.txt /usr/share/jenkins/ref/plugins.txt
# 3. Install all plugins and resolve transitive dependencies during image BUILD time!
# Bypasses runtime internet downloads and eliminates startup plugin download failures
RUN jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt \
--verbose \
--war /usr/share/jenkins/jenkins.war
# 4. Inject base Jenkins Configuration as Code (JCasC) definition
COPY --chown=jenkins:jenkins casc_configs/ /var/jenkins_home/casc_configs/
ENV CASC_JENKINS_CONFIG="/var/jenkins_home/casc_configs/"
# 5. Metadata Labels adhering to OCI standards
LABEL org.opencontainers.image.title="Enterprise-Hardened-Jenkins" \
org.opencontainers.image.version="2.440.3-v1.4" \
org.opencontainers.image.vendor="Nikita-Infotech"
# ==============================================================================
# PINNED PLUGIN MANIFEST (Format: plugin-id:version)
# Never use 'plugin-id:latest' in enterprise production environments!
# ==============================================================================
configuration-as-code:1775.v810dc950b_514
git:5.2.1
workflow-aggregator:596.v8c21c963d92d
kubernetes:4246.v008064b_a_747e
sonar:2.16.1
trivy:0.1.0
credentials-binding:681.vf91662a_3253b_
role-strategy:724.v58a_e98829b_d1
generic-webhook-trigger:2.2.2
prometheus:2.4.1
slack:684.v1f8c1da_ea_41e
PRE-PRODUCTION CONTROLLER VALIDATION WORKFLOW:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DEVELOPER UPDATES 'plugins.txt' OR JENKINS WAR VERSION β
β Submits Pull Request to 'jenkins-infra' repository β
ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STAGE 1: DOCKER CONTAINER COMPILATION β
β β’ Runs: jenkins-plugin-cli --plugin-file plugins.txt β
β β’ Resolves dependency tree without circular deadlocks β
β β’ Produces candidate image: jenkins-candidate:2.440.3 β
ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STAGE 2: EPHEMERAL SANDBOX CLUSTER VERIFICATION β
β β’ Mounts sanitized copy of $JENKINS_HOME (Job XMLs) β
β β’ Boots candidate container in isolated staging VPC β
β β’ Executes Automated Health Probes: β
β - Asserts HTTP 200 on /login β
β - Asserts 0 classloader exceptions in system logs β
β - Validates JCasC schema deserialization β
β - Executes sample pipeline job to verify agents β
ββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
β
ββββββββ΄βββββββ
β β
[ALL CHECKS PASS] [ANY EXCEPTION / CRASH]
β β
βΌ βΌ
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β STAGE 3: PROMOTE IMAGE β β REJECT PULL REQUEST β
β Tag as 'RELEASE-READY' β β Developer fixes conflict β
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
pipeline {
agent { label 'docker-capable-host' }
environment {
CANDIDATE_IMAGE = "registry.company.com/devops/jenkins-controller:${env.BUILD_NUMBER}"
}
stages {
stage('Build Candidate Image') {
steps {
echo "[*] Compiling immutable controller image with updated plugins..."
sh "docker build -t ${env.CANDIDATE_IMAGE} -f ci/Dockerfile.controller ."
}
}
stage('Ephemeral Validation Boot') {
steps {
echo "[*] Testing candidate image in isolated container sandbox..."
script {
def containerId = sh(
script: "docker run -d -p 8089:8080 ${env.CANDIDATE_IMAGE}",
returnStdout: true
).trim()
try {
// Wait for full startup initialization (Timeout: 90s)
sh '''
for i in {1..18}; do
CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8089/login || echo "000")
if [ "$CODE" -eq 200 ]; then
echo "[β] Candidate controller booted successfully (HTTP 200)."
exit 0
fi
echo "[-] Awaiting boot... ($CODE)"
sleep 5
done
echo "[β] Candidate controller failed to respond within 90s!"
exit 1
'''
// Inspect logs for plugin loading exceptions
sh """
if docker logs ${containerId} 2>&1 | grep -E -i "(PluginException|ClassCastException|Failed to load)"; then
echo "[β] CRITICAL: Plugin initialization exceptions detected in startup logs!"
exit 1
fi
"""
echo "[β] Zero plugin initialization errors detected in candidate image."
} finally {
sh "docker rm -f ${containerId} || true"
}
}
}
}
stage('Promote to Production Registry') {
steps {
echo "[β] Candidate verified. Pushing release image to production repository..."
sh "docker push ${env.CANDIDATE_IMAGE}"
}
}
}
}
BLUE-GREEN CONTROLLER TRAFFIC CUTOVER PHASES:
PHASE 1: LIVE STATE (BLUE ACTIVE, GREEN DORMANT)
βββββββββββββββββββββββββββββ Traffic (Port 443) βββββββββββββββββββββββββββββ
β REVERSE PROXY (NGINX/ALB) β βββββββββββββββββββββββββββΊ β CONTROLLER BLUE (v2.440.2)β
β Host: jenkins.company.com β β Active Volume: MOUNTED β
βββββββββββββββββββββββββββββ βββββββββββββββ¬ββββββββββββββ
β
βΌ
[$JENKINS_HOME EKS EBS PVC]
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
PHASE 2: DRAIN & DETACH STORAGE (MAINTENANCE WINDOW: ~60 SECONDS)
1. Controller Blue placed in Quiet Down mode (No new builds started).
2. Existing builds finish. Controller Blue process is stopped.
3. Storage Volume is cleanly unmounted from Blue.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
PHASE 3: ATTACH STORAGE TO GREEN & CUT OVER TRAFFIC
1. Storage Volume mounted to CONTROLLER GREEN (v2.440.3).
2. Controller Green boots with pre-warmed image; reaches readiness in 20 seconds.
3. Reverse Proxy switches upstream target:
βββββββββββββββββββββββββββββ Traffic (Port 443) βββββββββββββββββββββββββββββ
β REVERSE PROXY (NGINX/ALB) β βββββββββββββββββββββββββββΊ β CONTROLLER GREEN(v2.440.3)β
β Host: jenkins.company.com β β Active Volume: MOUNTED β
βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββ
Total User Impact: ~60 seconds of queue buffering; ZERO dropped builds or lost metadata!
#!/usr/bin/env bash
# ==============================================================================
# Script: execute_controller_cutover.sh
# Purpose: Orchestrates Kubernetes Deployment image update with automated rollback
# ==============================================================================
set -euo pipefail
NAMESPACE="cicd"
DEPLOYMENT="jenkins-controller"
NEW_IMAGE="registry.company.com/devops/jenkins-controller:2.440.3-v1.4"
echo "[*] Step 1: Initiating graceful drain via Quiet Down..."
./scripts/graceful_draining.sh
echo "[*] Step 2: Triggering atomic rolling deployment update..."
START_TIME=$(date +%s)
# Update deployment image; Kubernetes terminates old pod and launches new container
kubectl -n "${NAMESPACE}" set image deployment/${DEPLOYMENT} \
jenkins=${NEW_IMAGE}
echo "[*] Step 3: Awaiting new controller pod readiness probe..."
if kubectl -n "${NAMESPACE}" rollout status deployment/${DEPLOYMENT} --timeout=180s; then
END_TIME=$(date +%s)
ELAPSED=$((END_TIME - START_TIME))
echo "[β] SUCCESS: Controller upgraded to ${NEW_IMAGE} in ${ELAPSED} seconds!"
else
echo "[β] CATASTROPHE: New controller pod failed to reach ready state!"
echo "[!] Executing immediate automated rollback: kubectl rollout undo..."
kubectl -n "${NAMESPACE}" rollout undo deployment/${DEPLOYMENT}
kubectl -n "${NAMESPACE}" rollout status deployment/${DEPLOYMENT} --timeout=120s
exit 1
fi
echo "[*] Step 4: Disabling Quiet Down mode on updated controller..."
# Re-enable build scheduling on the newly active controller
sleep 5
curl -s -u "admin_lead:${API_TOKEN}" -X POST "https://jenkins.company.com/cancelQuietDown"
echo "[β] ZERO-DOWNTIME CONTROLLER UPGRADE COMPLETED SUCCESSFULLY."
THE TRANSITIVE PLUGIN DEPENDENCY CONFLICT (DIAMOND PROBLEM):
ββββββββββββββββββββββββββββββββ
β TOP-LEVEL PLUGIN: git β
β Version: 5.2.1 β
ββββββββββββββββ¬ββββββββββββββββ
β
βββββββββββββββββββ΄ββββββββββββββββββ
β Depends on: β Depends on:
βΌ βΌ
βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββ
β git-client:4.5.0 β β scm-api:676.v88e5 β
βββββββββββββββ¬ββββββββββββββ βββββββββββββββ¬ββββββββββββββ
β β
β Depends on: β Depends on:
β structs:324.va_f5 β structs:320.v5a_
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SHARED CORE LIBRARY: structs β
β CONFLICT: Two different versions requested simultaneously! β
β β’ JVM ClassLoader cannot load both versions into memory! β
β β’ Result: ClassCastException or MethodNotFoundException β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
HOW THE MODERN JENKINS PLUGIN CLI SOLVES THIS:
β’ Command: jenkins-plugin-cli --plugin-file plugins.txt
β’ Evaluates the complete Abstract Dependency Graph (DAG) across all requested plugins.
β’ Automatically resolves the highest compatible Upper Bound version (structs:324.va_f5).
β’ Guarantees that only a mathematically consistent set of plugins is written to disk!
# ==============================================================================
# Auditing Plugin Dependencies Using the Modern CLI Tool
# ==============================================================================
# 1. Download official Jenkins Plugin CLI utility
wget -O jenkins-plugin-cli.jar \
https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.12.15/jenkins-plugin-cli-2.12.15.jar
# 2. Run dependency resolution dry-run and export full transitive bill-of-materials
java -jar jenkins-plugin-cli.jar \
--plugin-file plugins.txt \
--war /usr/share/java/jenkins.war \
--output-format YAML \
--view-all-security-warnings \
--list-plugins-with-newer-versions
# 3. Output reveals:
# β’ Transitive dependencies that need upgrading
# β’ Security advisories (CVEs) affecting any installed plugin
# β’ Exact pinned versions required to eliminate classloader conflicts
#!/usr/bin/env bash
# ==============================================================================
# Script: emergency_controller_rollback.sh
# Purpose: Restores previous stable controller image and rolls back EBS snapshot
# Execution: Run immediately if upgraded controller crashes or fails post-upgrade smoke
# ==============================================================================
set -euo pipefail
NAMESPACE="cicd"
DEPLOYMENT="jenkins-controller"
PREVIOUS_STABLE_IMAGE="registry.company.com/devops/jenkins-controller:2.440.2-v1.3"
echo "[!] INITIATING EMERGENCY CONTROLLER ROLLBACK PROCEDURE..."
# 1. SCALE DOWN FAILING CONTROLLER WORKLOAD (RELEASES STORAGE LOCK)
echo "[*] Step 1: Scaling down failing controller pod..."
kubectl -n "${NAMESPACE}" scale deployment/${DEPLOYMENT} --replicas=0
kubectl -n "${NAMESPACE}" wait --for=delete pod -l app.kubernetes.io/name=jenkins --timeout=60s
# 2. REVERT DEPLOYMENT IMAGE SPECIFICATION TO PREVIOUS STABLE BUILD
echo "[*] Step 2: Reverting container image to: ${PREVIOUS_STABLE_IMAGE}..."
kubectl -n "${NAMESPACE}" set image deployment/${DEPLOYMENT} \
jenkins=${PREVIOUS_STABLE_IMAGE}
# 3. (OPTIONAL) RESTORE PRE-UPGRADE STORAGE SNAPSHOT IF METADATA WAS CORRUPTED
# If the failed upgrade ran database schema updates or corrupted config.xml,
# restore the PVC from the VolumeSnapshot created in pre-flight!
# kubectl -n "${NAMESPACE}" apply -f k8s/restore-pvc-from-pre-upgrade-snapshot.yaml
# 4. SCALE CONTROLLER WORKLOAD BACK UP
echo "[*] Step 3: Scaling controller back up to 1 replica..."
kubectl -n "${NAMESPACE}" scale deployment/${DEPLOYMENT} --replicas=1
# 5. AWAIT READINESS AND RESTORE TRAFFIC
echo "[*] Step 4: Waiting for stable controller restoration..."
kubectl -n "${NAMESPACE}" rollout status deployment/${DEPLOYMENT} --timeout=120s
echo "[β] EMERGENCY ROLLBACK COMPLETE: Controller restored to ${PREVIOUS_STABLE_IMAGE}."
COMMON UPGRADE & HIGH AVAILABILITY DEFECTS & REMEDIATIONS:
1. KUBERNETES VOLUME ATTACH DEADLOCK: "Multi-Attach error for volume ... Volume is already used by pod"
β’ Symptom: The new controller pod is stuck in 'ContainerCreating'; logs display Multi-Attach error.
β’ Cause: The old pod was not completely terminated before the new pod tried to attach the same AWS EBS volume.
β’ Remediation:
- Verify the Deployment strategy is set to: 'strategy: { type: Recreate }' (NOT RollingUpdate!).
- Force delete the terminating pod if stuck: kubectl delete pod <old-pod> --force --grace-period=0
2. UPGRADE CRASHES WITH CLASSLOADER CONFLICT: "java.lang.NoSuchMethodError: org.kohsuke.stapler..."
β’ Symptom: Jenkins starts, but navigation to any job page throws an HTTP 500 error stack trace.
β’ Cause: A plugin was updated in isolation, but it depends on a newer core method that does not
exist in the current Jenkins WAR binary.
β’ Remediation: Always update plugins in lockstep with the core Jenkins WAR using an immutable Dockerfile.
Never update a single plugin in production without pre-flight testing.
3. BUILDS FAIL AFTER CONTROLLER RESTART: "ChannelClosedException / Remoting connection lost"
β’ Symptom: Ephemeral agents running on Kubernetes fail when the controller restarts.
β’ Cause: The pipeline step was using a non-durable shell step or old remoting protocol.
β’ Remediation: Ensure the 'durable-task' plugin is updated. Modern Jenkins pipeline 'sh' and 'bat'
steps survive controller restarts by writing status to disk and reconnecting when the controller wakes up!
4. ACCIDENTAL SPLIT-BRAIN DISASTER:
β’ Defect: An SRE boots a "test" Jenkins master pointing to a restored copy of production storage,
but forgets to disable outbound webhooks or SCM polling!
β’ Consequence: The test master starts checking out PRs, executing deployments, and posting duplicate
status checks to GitHub!
β’ Remediation: In test/staging environments, launch Jenkins with:
-Dhudson.model.DirectoryBrowserSupport.CSP="" -Djenkins.model.Jenkins.crumbIssuer=null
and disable networking to production agent clusters.
HIGH AVAILABILITY & UPGRADE SPECIFICATION MATRIX:
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ¬βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β ARCHITECTURAL COMPONENT β TECHNICAL TOOLCHAIN β IMPLEMENTATION β PRIMARY OPERATIONAL PURPOSE β
βββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββΌβββββββββββββββββββΌββββββββββββββββββββββββββββββββ€
β Clustering Model β Active-Standby (Single Leaderβ Kubernetes Recreaβ Prevents $JENKINS_HOME corruptβ
β Draining Endpoint β POST /quietDown β HTTP REST API β Rejects new jobs; finishes oldβ
β Cancellation Endpoint β POST /cancelQuietDown β HTTP REST API β Restores normal scheduling β
β Immutable Packaging β Docker + jenkins-plugin-cli β Container Image β Pre-bakes plugins & dependenciesβ
β Version Pinning β plugins.txt (Exact SemVer) β Manifest File β Eliminates transitive drift β
β Volume Storage Class β AWS EBS gp3 (ReadWriteOnce) β Block Storage β Single-leader exclusive mount β
β Deployment Strategy β strategy: { type: Recreate } β Kubernetes Spec β Clean volume detach before attβ
β Pre-Upgrade Safety Net β AWS EBS VolumeSnapshot / CSI β Block Snapshot β Point-in-time storage rollbackβ
β Traffic Cutover Latency β Ingress / Proxy reload β < 60 seconds β Sub-minute user impact β
βββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββ΄βββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ€
β TOP 5 HIGH AVAILABILITY AXIOMS FOR DEVOPS SREs: β
β 1. Active-Standby Only: Never attempt active-active multi-master setups on open-source Jenkins. β
β 2. Quiet Down First: Always invoke '/quietDown' and wait for zero busy executors before stopping. β
β 3. Build Immutable Images: Bake plugins into Docker images using 'jenkins-plugin-cli'; ban UI updates. β
β 4. Pre-Upgrade Volume Snapshots: Always capture an EBS VolumeSnapshot of $JENKINS_HOME before upgrades. β
β 5. Use Recreate Deployments: Configure Kubernetes Deployments with 'type: Recreate' to avoid EBS locks. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ