-
-
Save shivannakarthik/a2bc4dcdb9093e61c7343a0b32c0a879 to your computer and use it in GitHub Desktop.
Revisions
-
initcron revised this gist
Jun 29, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Lab : Orchestrating and deploying app in Production with SWARM ## Deploying Application Stack with Swarm Mode and Stack version "3" specification -
initcron revised this gist
Jun 29, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,7 +61,7 @@ docker service inspect ``` ``` docker service update --publish-add 80:80 vote ``` Try accessing port 80 on any of the nodes in the swarm cluster to validate. -
initcron revised this gist
Jun 16, 2017 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -91,7 +91,7 @@ docker network inspect custom-01 docker service rm vote ``` ## Orchestrating Applications with Stack Deploy Copy compose file v3 into docker stack file @@ -121,5 +121,8 @@ docker service ls docker service scale voting_vote=4 ``` ### Creating Deploy Specs -
initcron revised this gist
Jun 16, 2017 . 1 changed file with 55 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,6 +35,61 @@ docker swarm init --advertise-addr _IPADDR_ Note down the command sequence to join swarm node, and execute it on all the other nodes which will form this swarm cluster. Verify the swarm is created by checking the visualizer. To recall join tokens for worker nodes, you could use ``` docker swarm join-token worker ``` [Sample Output] ``` docker swarm join \ --token SWMTKN-1-07fyl870ztlnrk8i2d58jn1igtrldahiwb2o6plf87dasa34dq-4ej0sofwoy4e62vgu6rvpcfys \ 138.197.71.9:2377 ``` ## Deploying Service with swarm - The imperative way ```sh docker service create --name vote schoolofdevops/vote ``` ```sh docker service ls docker service inspect ``` ``` docker service update --publish-add 80:5000 vote ``` Try accessing port 80 on any of the nodes in the swarm cluster to validate. #### Scaling a service ``` docker service scale vote=4 docker service ls docker service scale vote=2 ``` #### Adding service to a overlay network ``` docker network ls docker network create --driver overlay custom-01 docker network ls docker service update --network-add custom-01 vote docker network inspect custom-01 ``` #### Cleaning Up ``` docker service rm vote ``` ## Creating Docker Stack Definition -
initcron revised this gist
May 23, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ ## Deploying Application Stack with Swarm Mode and Stack version "3" specification ### Launch a Visualizer on Master (SWARM Manager) ``` -
initcron revised this gist
Mar 2, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,6 +44,9 @@ Copy compose file v3 into docker stack file cp docker-compose-v3.yml docker-stack.yml ``` Edit docker-stack.yml and update network driver from **bridge** to **overlay** Deploy a stack ``` -
initcron revised this gist
Feb 3, 2017 . 1 changed file with 27 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,5 +36,32 @@ docker swarm init --advertise-addr _IPADDR_ Note down the command sequence to join swarm node, and execute it on all the other nodes which will form this swarm cluster. Verify the swarm is created by checking the visualizer. ## Creating Docker Stack Definition Copy compose file v3 into docker stack file ``` cp docker-compose-v3.yml docker-stack.yml ``` Deploy a stack ``` docker stack deploy --compose-file docker-stack.yml voting ``` Validate ``` docker stack ls docker stack services voting docker service ls docker service scale voting_vote=4 ``` -
initcron revised this gist
Feb 3, 2017 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ ## Deploying Application Stack with Swarm Mode and Stack version "3" specification ### Launch a Visualizer @@ -23,7 +23,7 @@ ip addr Note down the IP address, lets call it as _IPADDR_ ### Setup Swarm Cluster On the master node, initialize swarm @@ -33,3 +33,8 @@ docker swarm init --advertise-addr _IPADDR_ ``` Note down the command sequence to join swarm node, and execute it on all the other nodes which will form this swarm cluster. Verify the swarm is created by checking the visualizer. -
initcron created this gist
Feb 3, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ ## Create a Docker Swarm Cluster ### Launch a Visualizer ``` docker run -itd -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock schoolofdevops/visualizer ``` Find out the IP address of the node which would be designated as master ``` ifconfig or ip addr ``` Note down the IP address, lets call it as _IPADDR_ ### Setup Master On the master node, initialize swarm ``` docker swarm init --advertise-addr _IPADDR_ ```