Jenkins Kubernetes Slave Pods fail to connect to Jenkins

3/17/2020

I have Jenkins running on one cluster, defined as a cloud in my Jenkins Kubernetes plugin which is working fine.

Then, I have another cluster which has a helm server already installed. I want to be able to run helm commands on this cluster during my builds, so I added another cloud where I want to create slave pods.

I am able to succesfully communicate from my Jenkins to the cluster, and can spin up a slave pod, but they all error out with this message:

java.io.IOException: Failed to connect to http://172.21.39.28:8080/tcpSlaveAgentListener/: connect timed out
        at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:197)
        at hudson.remoting.Engine.innerRun(Engine.java:523)
        at hudson.remoting.Engine.run(Engine.java:474)
Caused by: java.net.SocketTimeoutException: connect timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
        at sun.net.www.http.HttpClient.New(HttpClient.java:339)
        at sun.net.www.http.HttpClient.New(HttpClient.java:357)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
        at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:194)

Now, I know this has something to do with the Jenkins URL I'm defining for this cloud (http://172.21.39.28:8080) but I don't know what to put here. That's the IP in the cluster, but I've also tried the public URL (think http://jenkins.company.org:8080) and that hasn't worked either. Any suggestions?

-- Neil French
jenkins
kubernetes
kubernetes-helm

0 Answers