Use this when Jenkins agents run builds.
Agent · Jenkins
A Jenkins agent is a machine or container that runs build steps assigned by the controller, connected over SSH or inbound JNLP, selected by labels in the pipeline.
1. Agents execute builds.
2. Ephemeral agents (Kubernetes plugin) preferred.
3. Labels for capabilities.
4. Secure agent-controller channel.
5. Clean workspaces.
controller → agent (label) → build
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Static agents with leftover workspace state.
- Agents with more credentials than needed.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Agents run build steps assigned by the controller.
- Labels in the pipeline choose the agent.
- Agents need consistent tools and versions.
- Agent status in /computer — online
- Inbound (JNLP/WebSocket) vs SSH agents — connectivity
- Ephemeral agents (Kubernetes/cloud) — isolation
ReferenceWhy it matters1 section · depth on demand
What it is
Jenkins agents execute builds on separate machines or containers, connected via SSH or inbound JNLP/WebSocket.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
A Jenkins agent is a machine or container that runs build work on behalf of the controller. Agents let builds run in the right environment (Linux, Windows, specific tools), scale out capacity, and keep untrusted build code off the controller.
| Connection | How |
|---|---|
| SSH agent | Controller connects to the agent over SSH |
| Inbound (JNLP/WebSocket) | Agent connects to the controller |
| Cloud agents | Kubernetes, Docker, EC2 plugins create agents per build |
Labels match jobs to agents: agent { label 'linux && ansible' }. Ephemeral agents (a fresh pod per build) avoid leftovers from previous builds and are the safest default. When builds hang in the queue with "waiting for next available executor", no online agent has the requested label or free executors.
pipeline {
agent { kubernetes { yamlFile 'ci/pod.yaml' } }
stages { stage('Lint') { steps { sh 'ansible-lint' } } }
}
Mechanics
The linked authority for bounded mechanics is Jenkins User Handbook; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Jenkins > Agent. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.jenkins.io/doc/ · confidence 94%