I'm running Jenkins with worker nodes in a docker swarm. I use docker stack with a docker-compose.yml file to deploy the nodes. Within the Jenkins container, I have the swam plugin installed.
Everything went well, all nodes were detected on Jenkins startup and added to the master node. Now, suddenly this does not work anymore. The master node does not detect the worker nodes.
To init docker swarm I use
docker swarm init
To start my docker containers I use
docker stack deploy --compose-file <path_to_compose_file> <name_of_stack>
I reduced the docker-compose.yml to the essentials. docker-compose.yml:
version: '3'
services:
jenkins-master:
image: jenkins-master:latest
volumes:
- /var/docker-data/master-volume:/var/jenkins_home
- /var/docker-data/backup-volume:/var/lib/backup
ports:
- "443:8443"
- "80:8080"
- "50000:50000"
networks:
- jenkins_swarm
deploy:
placement:
constraints:
- node.role == manager
jenkins-worker:
image: jenkins-worker:latest
networks:
- jenkins_swarm
command: -labels "worker" -executors 8 -master "http://<IP of master>/"
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
networks:
jenkins_swarm:
Is anybody facing similar issues? Did I do something wrong?