Interview Prep/Jenkins/Agents, executors & the queue

A pipeline stage shows `Waiting for agent to connect (30/100): shack-app-main-12-x7k2p-9q8wz` and eventually fails

IntermediateTroubleshootingAgents, executors & the queue
Answer

Likely causes → The pod started but the jnlp container cannot reach the controller (wrong Jenkins URL, NetworkPolicy, DNS), or the pod is stuck Pending/ImagePullBackOff.

Diagnose →

kubectl -n jenkins-agents get pod shack-app-main-12-x7k2p-9q8wz -o wide
kubectl -n jenkins-agents describe pod shack-app-main-12-x7k2p-9q8wz
kubectl -n jenkins-agents logs shack-app-main-12-x7k2p-9q8wz -c jnlp

Fix → Correct jenkinsUrl (e.g. http://jenkins.jenkins.svc.cluster.local:8080/), enable WebSocket, allow egress to the Jenkins service in NetworkPolicy, fix image names.

Prevent → Smoke pipeline after any cloud or network change.

All Jenkins questions Roadmap: Jenkins

More on Agents, executors & the queue