How does an agent communicate with the controller?
IntermediateConceptArchitecture, executors & JENKINS_HOME
Answer
Through the remoting library, a bidirectional channel that serializes commands and streams. Connection modes:
- SSH launcher: controller connects out to the agent over SSH and starts
agent.jar. - Inbound (formerly JNLP): the agent starts
agent.jarand connects to the controller, either over WebSocket on the HTTP port (recommended, works through ingress and proxies) or over the TCP agent port (default 50000). - Cloud plugins (kubernetes, EC2) provision a machine or pod which then connects inbound.
java -jar agent.jar -url https://jenkins.example.com/ \
-secret @secret-file -name linux-01 -webSocket -workDir /home/jenkins/agent
More on Architecture, executors & JENKINS_HOME
What are the main components of a Jenkins installation?BeginnerWhat is the difference between a node, an agent and an executor?BeginnerWhy should the built-in node have 0 executors?BeginnerWhat is `JENKINS_HOME` and what are its most important contents?BeginnerWhat happens if you lose the `secrets/` directory but keep `credentials.xml`?AdvancedWhat is the build queue and what can keep an item waiting in it?Intermediate