Puppet Docker How can a user initialize join and leave the swarm

0 votes
Can somebody explain how can a user initialize, join and leave a swarm?
Aug 14, 2019 in Puppet by Sirajul
• 59,230 points
1,099 views

1 answer to this question.

0 votes
  • The docker module has an example task that allows a user to initialize, join and leave a swarm.
bolt task run docker::swarm_init listen_addr=172.17.10.101 adverstise_addr=172.17.10.101 ---nodes swarm-master --user <user> --password <password> --modulepath <module_path>
docker swarm init --advertise-addr=172.17.10.101 --listen-addr=172.17.10.101
Swarm initialized: current node (w8syk0g286vd7d9kwzt7jl44z) is now a manager.
  • To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-317gw63odq6w1foaw0xkibzqy34lga55aa5nbjlqekcrhg8utl-08vrg0913zken8h9vfo4t6k0t 172.17.10.101:2377
  • To add a manager to this swarm, run docker swarm join-token manager and follow the instructions.
Ran on 1 node in 4.04 seconds
bolt task run docker::swarm_token node_role=worker ---nodes swarm-master --user <user> --password <password> --modulepath <module_path>
SWMTKN-1-317gw63odq6w1foaw0xkibzqy34lga55aa5nbjlqekcrhg8utl-08vrg0913zken8h9vfo4t6k0t
Ran on 1 node in 4.02 seconds
bolt task run docker::swarm_join listen_addr=172.17.10.102 adverstise_addr=172.17.10.102 token=<swarm_token> manager_ip=172.17.10.101:2377 --nodes swarm-02 --user root --password puppet --modulepath /tmp/modules
This node joined a swarm as a worker.
Ran on 1 node in 4.68 seconds
bolt task run docker::swarm_leave --nodes swarm-02 --user root --password puppet --modulepath --modulepath <module_path>
Node left the swarm.
Ran on 1 node in 6.16 seconds
answered Aug 14, 2019 by Lilly

Related Questions In Puppet

0 votes
1 answer

How can i know the time as to when exactly did a node join puppet?

Puppet does not itself keep any timestamp ...READ MORE

answered Aug 8, 2019 in Puppet by Sirajul
• 59,230 points
735 views
0 votes
1 answer

Can i install puppet master and puppet agent on the same centos machine? How will that work?

Yes, It's now possible to install both ...READ MORE

answered Aug 6, 2019 in Puppet by Sirajul
• 59,230 points
1,168 views
0 votes
0 answers
0 votes
1 answer

Puppet+Docker: How do i configure a swarm if i am using windows server 2016.

There are a few considerations to be ...READ MORE

answered Aug 16, 2019 in Puppet by Sirajul
• 59,230 points
943 views
+2 votes
1 answer
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
3,979 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP