I have a hybrid Kubernetes cluster with a Linux master and windows slave node. The Kubernetes plugin is set up to start up with a custom container that executes this command at the end of an internal script "java -cp C:\slave.jar hudson.remoting.jnlp.Main -headless -url http://172.31.50.121:8080 -workDirC:\jenkins\agents <secert> <pod name>". The widows pod connects to the jenkins master fine, however throws an error immediately ending the build.
java.nio.file.NoSuchFileException: \etc\hostname ... Caused: java.io.IOException ... Finished: FAILURE
And the logs from the container is:
Aug 13, 2018 8:02:08 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: windows-jnlp-8qzm5
Aug 13, 2018 8:02:08 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Aug 13, 2018 8:02:09 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 3.21
Aug 13, 2018 8:02:09 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using C:\jenkins\remoting as a remoting work directory
Both error and output logs will be printed to C:\jenkins\remoting
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http://172.31.50.121:8080]
Aug 13, 2018 8:02:09 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, CLI2-connect, JNLP-connect, Ping, CLI-connect, JNLP2-connect]
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Agent discovery successful
Agent address: 172.31.50.121
Agent port: 50000
Identity: 19:cd:77:66:ee:19:26:e8:df:4a:ea:c2:4e:ae:da:3d
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to 172.31.50.121:50000
Aug 13, 2018 8:02:09 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP4-connect
Aug 13, 2018 8:02:11 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Remote identity confirmed: 19:cd:77:66:ee:19:26:e8:df:4a:ea:c2:4e:ae:da:3d
Aug 13, 2018 8:02:12 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
Aug 13, 2018 8:02:15 PM hudson.remoting.Request$2 run
INFO: Failed to send back a reply to the request hudson.remoting.Request$2@6efad725: hudson.remoting.ChannelClosedException: Channel "hudson.remoting.Channel@407b3d4a:JNLP4-connect connection to 172.31.50.121/172.31.50.121:50000": channel is already closed
Aug 13, 2018 8:02:15 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Terminated
Based on these error I think its expecting a Linux environment.Is slave.jar for Linux vms only? Or do I need to specify in the argument its is windows?