0

I am trying to setup Pumba on my docker swarm setup. I tried using the docker service create, docker stack deploy and a simple docker run command with following parameters:

docker run -d -v /var/run/docker.sock:/var/run/docker.sock gaiaadm/pumba:master Pumba kill --signal SIGTERM
docker service create --constraint 'node.role == manager' --mount type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock gaiaadm/pumba:master --with-registry-auth

docker-compose.yaml is:

version: "3.4"  
services:  
  pumba: 
    image: gaiaadm/pumba:latest  
    volumes:  
          - /var/run/docker.sock:/var/run/docker.sock  
    deploy:  
      replicas: 3    
    command: ["pumba", "kill","re2:^customer-api*","--signal", "SIGTERM"]  

and created the above compose file for stack deploy.
But in all the cases the pumba container just kills the mentioned container as customer-api* in compose file above and exits and restarts due to swarm maintaining state feature
I need the container to keep running.
I am new to docker and Pumba any help or direction will be really appreciated.
Thanks in advance.

nickgryg
  • 25,567
  • 5
  • 77
  • 79
vhashmode
  • 221
  • 1
  • 2
  • 8

1 Answers1

0

I am able to solve the problem using the following service create command:

docker service create --name PUMBA --mode=global   --mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock  gaiaadm/pumba:master pumba --random --interval 10s kill re2:"^customer-api*" --signal SIGTERM

I deployed it in global mode and changed Pumba command, after doing this Pumba doesn't kill itself and container keeps on running.

vhashmode
  • 221
  • 1
  • 2
  • 8