Kubernetes Jenkins plugin - Jenkins doesn’t have label mypod
The keyword is (as always): look at the logs! You should see your errors when issuing
kubectl logs $JENKINS_POD_NAME
Also, you can try the command below. Here, your faulted slaves will be listed. Look at the logs for these:
kubectl get pods -a
Your issue is related to JNLP communication, slave->master
My jenkins is running in a container and I had to expose the JNLP port to the cluster-node (nodePort).
apiVersion: v1kind: Servicemetadata: name: jenkins labels: app: jenkinsspec: ports: - name: jnlp port: 40294 targetPort: 40294 - name: http port: 80 targetPort: 8080 selector: app: jenkins tier: jenkins type: NodePort
Also in jenkins security, look for JNLP and enable ALL protocols. I am still playing with fixed or random ports. Not sure how I can expose random port from a k8s service. Port-range is not supported in k8s.
But I am able to fire off a slave and do some work!