Jenkins agent.jar when running agents in Kubernetes?

I am running Jenkins in Kuberntes using the k8s plugin (for some reason I cannot post links in the forum)

I have created some podTemplates and a few containers based on maven and gradle docker images.

I keep reading about the jenkins agent.jar that should be started from the agents (again I have a link to an official jenkins blog but I am not allowed to post links :frowning:

But currently I just use gradle:jdk11 for my build agents and I don’t see that containing any agent.jar.

Is the agent.jar only relevant/needed when running jenkins controller/agents in a non-k8s environment?

Good question. The kubernetes plugin usage section says:

The Kubernetes plugin allocates Jenkins agents in Kubernetes pods. Within these pods, there is always one special container jnlp that is running the Jenkins agent.

The container jnlp is used by the Kubernetes plugin to run the Jenkins agent.jar.

Ok but from that page - that I am not allowed to link to (quite frustrating):

  • jenkins/agent is the new name of the old jenkins/slave image, starting from 4.3-2
  • jenkins/inbound-agent is the new name of the jenkins/jnlp-slave image, starting from 4.3-2

so its two different images. I get that the jnlp container is needed but I don’t really see any reason why the jenkins/agent container is needed?

As far as I can tell, history more than anything. We’ve considered combining the agent repository, inbound agent repository, and ssh agent repository into a single repository. The jenkins/agent image is used as the basis for jenkins/inbound-agent. I believe it is also used as the basis for other images.

Got it. Looking that the jenkins/agent dockerfile:

it seems its basically setting up a JDK and the jenkins uid/gid.

And then the jenkins/inbound-agent

use jenkins/agent as base image - getting the same uid/gid as the jenkins/agent.