Interview Prep/Jenkins/Architecture, executors & JENKINS_HOME

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.jar and 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
All Jenkins questions Roadmap: Jenkins

More on Architecture, executors & JENKINS_HOME