What the problem Base on below configuration, I did 2 test case:
Created Pod: kube-com-mini-fqt9p in namespace kube-system
Waiting for Pod to be scheduled (0/100): kube-com-mini-fqt9p
Container is waiting kube-com-mini-fqt9p [jnlp]: ContainerStateWaiting(message=null, reason=ContainerCreating, additionalProperties={})
Waiting for Pod to be scheduled (1/100): kube-com-mini-fqt9p
Waiting for agent to connect (1/100): kube-com-mini-fqt9p
Waiting for agent to connect (2/100): kube-com-mini-fqt9p
Waiting for agent to connect (3/100): kube-com-mini-fqt9p
Waiting for agent to connect (4/100): kube-com-mini-fqt9p
Waiting for agent to connect (5/100): kube-com-mini-fqt9p
Waiting for agent to connect (6/100): kube-com-mini-fqt9p
Waiting for agent to connect (7/100): kube-com-mini-fqt9p
Waiting for agent to connect (8/100): kube-com-mini-fqt9p
Waiting for agent to connect (9/100): kube-com-mini-fqt9p
Waiting for agent to connect (10/100): kube-com-mini-fqt9p
Waiting for agent to connect (11/100): kube-com-mini-fqt9p
Waiting for agent to connect (12/100): kube-com-mini-fqt9p
Waiting for agent to connect (13/100): kube-com-mini-fqt9p
Waiting for agent to connect (14/100): kube-com-mini-fqt9p
\============================================================== ENV:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:08:19Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Jenkins Version :Jenkins ver. 2.138
Jenkins kubernetes Plugin : 1.12.3
What I have done:
FROM jenkins/slave:3.23-1-alpine
MAINTAINER Oleg Nenashev <o.v.nenashev@gmail.com>
LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="3.23"
COPY jenkins-slave /usr/local/bin/jenkins-slave
ENTRYPOINT ["jenkins-slave"]
how to triger the job:
Jenkins trigger jobs by curl command (not in the pipeline), jenkins kubernetes plugin can trigger jobs with my defined images.
Issue was fixed with below actions:
Rename your container name to jnlp in the kubernetes plugin.
Keep the JNLP configured correctly in your images ENTRYPOINT From specific-images
(COPY jenkins-slave /usr/local/bin/jenkins-slave ENTRYPOINT ["jenkins-slave"])
Let "command to run" and arguments to pass to the command empty.