Hi everyone, hope you doing well. I’m facing issue with jenkins agent as k8s pod in eks cluster. Currently, I setup jenkins controller expose service port 8080, there are no problem if I set cloud pod template is connected by websocket. However, if I select agent pod via Jenkinsfile, it show error:
Created Pod: kubernetes jenkins/k8s-pod-j4gk9-57w57
jenkins/k8s-pod-j4gk9-57w57 Container jnlp was terminated.
jenkins/k8s-pod-j4gk9-57w57 Container jnlp was terminated.
- jnlp -- terminated (255)
-----Logs-------------
Nov 18, 2024 4:24:50 AM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using /home/jenkins/agent/remoting as a remoting work directory
Nov 18, 2024 4:24:50 AM hudson.remoting.Launcher$CuiListener status
INFO: Locating server among [http://jenkins.jenkins.svc.cluster.local:8080/]
Nov 18, 2024 4:24:50 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
Nov 18, 2024 4:24:50 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting TCP connection tunneling is enabled. Skipping the TCP Agent Listener Port availability check
Nov 18, 2024 4:24:50 AM hudson.remoting.Launcher$CuiListener status
INFO: Agent discovery successful
Agent address: jenkins-agent.jenkins.svc.cluster.local
Agent port: 50000
Identity: 82:e5:c6:47:cf:11:58:e5:cf:74:22:e6:f3:ee:25:43
Nov 18, 2024 4:24:50 AM hudson.remoting.Launcher$CuiListener status
INFO: Handshaking
Nov 18, 2024 4:24:50 AM hudson.remoting.Launcher$CuiListener status
INFO: Connecting to jenkins-agent.jenkins.svc.cluster.local:50000
Nov 18, 2024 4:24:50 AM hudson.remoting.Launcher$CuiListener error
SEVERE: null
java.nio.channels.UnresolvedAddressException
at java.base/sun.nio.ch.Net.checkAddress(Unknown Source)
at java.base/sun.nio.ch.Net.checkAddress(Unknown Source)
at java.base/sun.nio.ch.SocketChannelImpl.checkRemote(Unknown Source)
at java.base/sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at java.base/java.nio.channels.SocketChannel.open(Unknown Source)
at org.jenkinsci.remoting.engine.JnlpAgentEndpoint.open(JnlpAgentEndpoint.java:231)
at hudson.remoting.Engine.connectTcp(Engine.java:1054)
at hudson.remoting.Engine.innerRun(Engine.java:922)
at hudson.remoting.Engine.run(Engine.java:588)
- jnlp -- terminated (255)
-----Logs-------------
I assume that it is override by Agent global config TCP ( I try disable, it not working also). I see that invoke service jenkins-agent via port 50000, it mean I have to I need expose jenkins controller port 50000 via service name jenkins-agent
, isn’t it?
what should I do to resolve it. I researched some docs and blog, it dont tell create service jenkins-agent