I set up a Jenkins master on Azure container service (Kubernetes). I got a lot of warning since the Jenkins master was set up and never end:
Sep 15, 2017 8:33:23 AM hudson.TcpSlaveAgentListener$ConnectionHandler run WARNING: Connection #600 failed java.io.EOFException at java.io.DataInputStream.readFully(DataInputStream.java:197) at java.io.DataInputStream.readFully(DataInputStream.java:169) at hudson.TcpSlaveAgentListener$ConnectionHandler.run(TcpSlaveAgentListener.java:213) Sep 15, 2017 8:33:23 AM hudson.TcpSlaveAgentListener$ConnectionHandler run WARNING: Connection #602 failed java.io.EOFException at java.io.DataInputStream.readFully(DataInputStream.java:197) at java.io.DataInputStream.readFully(DataInputStream.java:169) at hudson.TcpSlaveAgentListener$ConnectionHandler.run(TcpSlaveAgentListener.java:213) Sep 15, 2017 8:33:27 AM hudson.TcpSlaveAgentListener$ConnectionHandler run WARNING: Connection #603 failed java.io.EOFException at java.io.DataInputStream.readFully(DataInputStream.java:197) at java.io.DataInputStream.readFully(DataInputStream.java:169) at hudson.TcpSlaveAgentListener$ConnectionHandler.run(TcpSlaveAgentListener.java:213)
Although there is a lot of warning, but everything is OK. I can even use Azure VM plugin to set up jnlp slaves.
I think this issue related to port: 50000 because if I expose port 50000 as a cluster port, there is no error. However, if I set port 50000 as LoadBalancer (we have to do this), the errors shows above.
Here is my kube files:
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: azdisk spec: accessModes: - ReadWriteOnce resources: requests: storage: 5Gi storageClassName: azuredisk --- kind: Deployment apiVersion: apps/v1beta1 metadata: name: jenkins-1 spec: replicas: 1 template: metadata: name: jenkins-1 labels: app: jenkins-1 spec: containers: - name: jenkins-container image: zackliu1995/jenkins volumeMounts: - name: azure mountPath: /var/jenkins_home securityContext: privileged: true ports: - name: port8080 containerPort: 8080 protocol: TCP - name: port50000 containerPort: 50000 protocol: TCP - name: port22 containerPort: 22 volumes: - name: azure persistentVolumeClaim: claimName: azdisk --- apiVersion: v1 kind: Service metadata: name: jenkins-srv spec: selector: app: jenkins-1 ports: - name: http port: 80 protocol: TCP targetPort: 8080 - name: slave port: 50000 protocol: TCP targetPort: 50000 - name: ssh port: 22 targetPort: 22 type: LoadBalancer
I tried official Jenkins image, it caused the same issue.
Why do you have to set up a port as a load balancer?
If you want to setup high availability or load balancing for Jenkins, the recommended approach is to expose ports of underlying Jenkins master instances and let agents connect to them directly using the "hudson.TcpSlaveAgentListener.hostName" system property (it will be returned to agents in HttpResponse headers)