Interview Prep/CI/CD/Jenkins Pipelines and Agents

Builds queue for 20 minutes during the morning rush, but the Jenkins nodes are mostly idle at night. What do you do?

IntermediateScenarioJenkins Pipelines and Agents
Answer

Situation read → Static capacity sized for neither peak nor trough.

What I'd do →

  1. Move builds to ephemeral agents: the Kubernetes plugin (pod per build) or EC2 Fleet plugin with an ASG.
  2. Define pod templates with the build tools baked into images, and set idleMinutes low.
  3. Set controller executors to 0 so nothing builds on it.
  4. Add queue-time metrics (Prometheus plugin) to prove the improvement.

Why → Capacity follows demand, every build gets a clean environment, and you stop paying for idle VMs.

Interview tip → Watch for the trade-off: cold pod start and image pull time, so keep images small and cached.

All CI/CD questions

More on Jenkins Pipelines and Agents