Jenkins kubernetes plugin: provided port:50000 is not reachable

Viewed 9354

I have set up jenkins on GKE using the official helm chart.

I have also created an nginx-ingress controller installation using helm and I am able to access jenkins via https://112.222.111.22/jenkins where 112.222.111.22 is the static IP I am passing to the load balancer.

I am also able to create jobs.

However, when I try to spin up inbound remote agent:

▶ java -jar agent.jar -noCertificateCheck -jnlpUrl https://112.222.111.22/jenkins/computer/My%20Builder%203/slave-agent.jnlp -secret <some_secret>


...
WARNING: Connect timed out
Feb 28, 2020 5:57:18 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: https://112.222.111.22/jenkins/ provided port:50000 is not reachable
java.io.IOException: https://112.222.111.22/jenkins/ provided port:50000 is not reachable
    at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:303)
    at hudson.remoting.Engine.innerRun(Engine.java:527)
    at hudson.remoting.Engine.run(Engine.java:488)

Why is that?

3 Answers

I had similar issue. I have solved it enabling the "Use WebSocket". Jenkins Salve/Agent > Configure > Launch Method > Use WebSocket (enable) > Save.

Might be because port 50000 is not open in the Jenkins master.

You can try to open the port by Creating Inbound rule in Jenkins Master's firewall which allows Port 50000 (coming from other machine in this case Agent, hence Inbound rule). Try following steps:

  1. Go to Master Jenkins.
  2. Open Wiindows Defender Firewall--> Advance setting --> create Inbound Rule allow port 50000

enter image description here

Note: In 1 inbound rule you can allow more than one port as shown in below.

  1. Restart master Jenkins service.

  2. Check if (step is valid only if you have created windows service on agent) agent service is running continuously.

Check Agent status in Jenkins !

looks like port 50000 is not open in the jenkins master. Try to open the port and restart the machine and instance ( i.e jenkins via url ) and see if it helps.

Related