Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Lesson Learned from Using Docker Swarm at Pronto

929 views

Published on

Docker Meetup 2016

Published in: Technology

Lesson Learned from Using Docker Swarm at Pronto

  1. 1. USING DOCKER SWARM 
 AT PRONTO L E S S O N L E A R N E D F R O M www.prontotools.io K A N O U I V I R A C H
  2. 2. K A N O U I V I R A C H A B O U T M E Research & Development Engineer
  3. 3. D O C K E R S WA R M
  4. 4. M I C R O S E R V I C E S https://www.nginx.com/blog/introduction-to-microservices/
  5. 5. . . H O W W E ’ V E S E T U P. .
  6. 6. docker swarm init docker network create -d overlay --subnet=192.168.0.0/24 simplesat
  7. 7. docker service create --name survey --network simplesat survey:stable docker service update --image survey:live survey
  8. 8. docker swarm join --token SWMTKN-1-0nqrebfaz7qc6deimizh4tfqa vfq5pam1qt08alxots8w5x9fv-8ii4ina9 fm640am99z1tbpfvl 192.168.65.2:2377 docker swarm join-token manager To add a worker to swarm To add a manager to swarm
  9. 9. O U R B U I L D P I P E L I N E 
 L O O K S L I K E
  10. 10. Check-In BUILD PIPELINE FOR SERVICE 1 BUILD PIPELINE FOR SERVICE 2 BUILD PIPELINE FOR SERVICE 3 BUILD PIPELINE FOR SERVICE 4
  11. 11. C O N T I N U O U S 
 I N T E G R AT I O N P R O C E S S
  12. 12. Check - In Static Analysis Unit Tests Build & Push Push Deploy Production Pull Deploy Dev Pull
  13. 13. – I N S P I R E D B Y Y E L P Docker Images Versioning for Continuous Delivery
  14. 14. docker build -t ${package}:${GIT_COMMIT} docker tag ${package}:${GIT_COMMIT}
 ${package}:unstable During the first docker build
  15. 15. docker tag ${package}:${GIT_COMMIT} 
 ${package}:stable docker push ${package}:${GIT_COMMIT} docker push ${package}:stable After the tests pass
  16. 16. docker tag ${package}:${GIT_COMMIT} 
 ${package}:live docker push ${package}:live After deployment succeeds
  17. 17. . . W H AT W E ’ V E L E A R N E D . . http://bocabraincenter.com/conditions/learning-disabilities/
  18. 18. Follow the practices • One process per one container • Use an appropriate base image (official base image)
  19. 19. S E R V I C E N A M E I N T H E C O D E ! SURVEY_API_URL = 'http://survey:8000/api/'
  20. 20. R O L L I N G U P D AT E S 
 F… C O O L F E AT U R E ! I S Effortless with Blue-Green Deployment
  21. 21. – E A S Y T O M A I N TA I N Keep services in one single repository
  22. 22. Environment variables – ALLOW US TO HAVE SAME IMAGE 
 ON ALL KINDS OF SERVERS
  23. 23. D O C K E R S WA R M couldn’t automatically pull images from private registry when update a service
  24. 24. --with-registry-auth Ex. docker service update --with-registry-auth --image simplesat-gateway:cc01ef0c gateway
  25. 25. (A bit) complex command
  26. 26. . . W H AT W E P L A N . . https://unsplash.com/photos/CkH1Hh8kllA
  27. 27. Monitoring
  28. 28. Log centralization
  29. 29. Docker images versioning management
  30. 30. More integration tests
  31. 31. Questions?
  32. 32. www.facebook.com/girlswhodev/
  33. 33. We are hiring! https://www.prontomarketing.com/company/careers/

×