Interview Prep/Jenkins/Agents, executors & the queue

Builds randomly fail with `Agent shack-app-pr-7-abc was deleted; cancelling node body`

IntermediateTroubleshootingAgents, executors & the queue
Answer

Likely causes → The pod was deleted underneath the build: node scale-down by the cluster autoscaler, eviction due to memory/ephemeral storage, spot/preemptible node reclaim, or activeDeadlineSeconds.

Diagnose → kubectl get events -n jenkins-agents --sort-by=.lastTimestamp, autoscaler logs, node termination events.

Fix → Add cluster-autoscaler.kubernetes.io/safe-to-evict: "false" annotation to agent pods, set proper requests/limits, avoid spot nodes for long builds or add retry(conditions: [kubernetesAgent()]).

Prevent → Separate node pool for agents with tuned autoscaler settings.

All Jenkins questions Roadmap: Jenkins

More on Agents, executors & the queue