My main task is to create a Jenkins Node from an EC2 instance/server.
Jenkins server it's on EKS deployed via jx
$ jx version
jx 2.0.818
jenkins x platform 2.0.1376
Kubernetes cluster v1.13.12
kubectl v1.17.0
helm client Client: v2.16.1
git 2.23.0
Operating System Mac OS X 10.15.4
The problems I am facing:
- The Helm chart for Jenkins deploys 2 services named
jenkins-agent
andjenkins
. related issue - The ingress it's configured by default to use just
jenkins
service as backend and port50000
isn't reachable for external agents via HOST. - I can't edit the
jenkins
ingress to point at servicejenkins
with 2 backend ports8080
&50000
(ingress allows just one port per service/path!). related issue
You can see here that here is 2 services: 1 jenkins
for jenkins master and one for jenkins slave jenkins-agent
, but only one ingress jenkins
which points to jenkins
svc backend on port 8080
.
$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
heapster ClusterIP ************ <none> 8082/TCP
jenkins ClusterIP ************ <none> 8080/TCP
jenkins-agent ClusterIP ************ <none> 50000/TCP
jenkins-x-chartmuseum ClusterIP ************ <none> 8080/TCP
jenkins-x-docker-registry ClusterIP ************ <none> 5000/TCP
$ kubectl get ingress
NAME HOSTS ADDRESS PORTS
chartmuseum chartmuseum.** ***.amazonaws.com 80
docker-registry docker-registry.** ***.amazonaws.com 80
jenkins jenkins.** ***.amazonaws.com 80
I tried to create another ingress specific for jenkins-agent
svc and to use something like alb.ingress.kubernetes.io/group.name: mygroup
. info link
I failed to bind 2 ingresses together, unfortunately the jenkins
ingress has kubernetes.io/ingress.class: nginx
and ingress.class
does't have this feature...
I checked the SecurityGroups to have the port 50000
open.
I tried to go on AWS and to add manually a 50000
port to load balancer but still when I am running on EC2 this command:
java -jar agent.jar -jnlpUrl http://JENKINS_URL/computer/****-service/slave-agent.jnlp -secret ****** -workDir "/home/ec2-user/jenkins_home" -failIfWorkDirIsMissing
Fails with this Error:
provided port:50000 is not reachable
How to add an external Jenkins Slave to a Jenkins which 2 services one for UI and Another for Agent. The above java
command requires both ports to be open!
On the same PATH
because you need port 8080 to get the slave-agent.jnlp
and after you get it, in the background it's trying to connect to port 50000
I am out of ideas...