Skip to content

Commit

Permalink
Merge pull request #1457 from jglick/connection-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlatombe authored Nov 8, 2023
2 parents 758a0c6 + 6f97418 commit 1bfad7f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Docker image ID for a jenkins JNLP agent.
This image is responsible to run a jenkins jnlp bootstrap agent and connect to Jenkins controller.
Secret key and agent name as well as jenkins callback URL are passed as argument as expected
by <code>hudson.remoting.jnlp.Main</code>.

Container image (repository, name, and tag) for a Jenkins inbound agent.
Connection details will be passed as environment variables as per
<a href="https://github.com/jenkinsci/docker-inbound-agent/#running-this-container">documentation</a>.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The name for the container to be run.

One container is automatically created with name <code>jnlp</code>, and runs the Jenkins JNLP agent service.
One container is automatically created with the name <code>jnlp</code>, and runs the Jenkins agent.

In order to replace the default JNLP agent, the name of the container with the custom JNLP image must be <code>jnlp</code>.
In order to replace the default agent image, the container with the agent must be named <code>jnlp</code>.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ THE SOFTWARE.
<f:textbox/>
</f:entry>

<f:entry title="${%JNLP Docker Registry}" field="jnlpregistry">
<f:entry title="${%Agent Docker Registry}" field="jnlpregistry">
<f:textbox/>
</f:entry>

<f:entry title="${%Inject restricted PSS security context in JNLP container definition}" field="restrictedPssSecurityContext">
<f:entry title="${%Inject restricted PSS security context in agent container definition}" field="restrictedPssSecurityContext">
<f:checkbox/>
</f:entry>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
<div>
<p>
With this option it is possible to connect directly to the TCP agent listener port.
This skips the connect to an HTTP(S) port to retrieve the connection information.
This skips the connection to an HTTP(S) port to retrieve some metadata.
</p>

<p>
This is useful in scenarios where the controller does not expose an HTTP(S) port, for example
<a target="_blank" href="https://github.com/jenkinsci/jenkinsfile-runner">Jenkinsfile Runner</a>.
</p>

<p>
Here is an example how the connect on agent side would look like. Most parameters are provided automatically when you enable the <i>Direct Connection</i> option.
<pre>
java -cp agent.jar hudson.remoting.jnlp.Main \
-headless \
-workDir &lt;WORK_DIRECTORY&gt; \
-direct &lt;MASTER_HOST:TCP_AGENT_LISTENER_PORT&gt; \
-protocols JNLP4-connect \
-instanceIdentity &lt;INSTANCE_IDENTITY&gt; \
&lt;SECRET_STRING&gt; &lt;AGENT_NAME&gt;
</pre>
</p>

<p>
You find more information in the <a target="_blank" href="https://github.com/jenkinsci/remoting">Jenkins Remoting</a> project.
<a target="_blank" href="https://github.com/jenkinsci/jenkinsfile-runner">Jenkinsfile Runner</a>,
but more commonly if you simply wish to optimize the connection slightly.
</p>

<p>
<b>Note:</b> In <i>Direct Connection</i> mode agents will not be able to reconnect to a restarted controller if a <i>Random</i> 'TCP port for inbound agents' is configured!<br/>
<b>Note:</b> <i>Direct Connection</i> requires a <a target="_blank" href="https://hub.docker.com/r/jenkins/inbound-agent/tags">inbound-agent</a> image with a version equal or higher than 3.35-5.<br/>
<b>Note:</b> <i>Direct Connection</i> does not work with the currently available <code>jenkins/inbound-agent:windowsservercore-1809</code> image.
</p>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div>
Provide the docker registry you want to use to pull the JNLP image if none is specified
</div>
Provide the Docker registry you want to use to pull the agent image if none is specified
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ KubernetesSlave.AgentIsProvisionedFromTemplate=Agent {0} is provisioned from tem
RFC1123.error=Container Names MUST match RFC 1123 - They can only contain lowercase letters, numbers or dashes: {0}
label.error=Labels must follow required specs - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set: {0}
KubernetesFolderProperty.displayName=Kubernetes
KubernetesSlave.HomeWarning=[WARNING] HOME is set to / in the jnlp container. You may encounter \
KubernetesSlave.HomeWarning=[WARNING] HOME is set to / in the agent container. You may encounter \
troubles when using tools or ssh client. This usually happens if the uid doesn't have any \
entry in /etc/passwd. Please add a user to your Dockerfile or set the HOME environment \
variable to a valid directory in the pod template definition.
KubernetesCloudNotAllowed.Description=Kubernetes cloud {0} is not allowed for folder containing job {1}
KubernetesCloudNotAllowed.Description=Kubernetes cloud {0} is not allowed for folder containing job {1}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>
Specify time in seconds up to which Jenkins should wait for the JNLP agent to establish a connection.<br/>
Specify time in seconds up to which Jenkins should wait for the agent to establish a connection.<br/>
Value must be a positive integer.
</p>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p>Name of the default container steps will be run in.</p>

<p>When using this option, all steps will be executed within an implicit <code>container(name) {...}</code> block instead
of the jnlp container.</p>
of the <code>jnlp</code> container.</p>

0 comments on commit 1bfad7f

Please sign in to comment.