Top Banner
USING DOCKER SWARM AT PRONTO LESSON LEARNED FROM www.prontotools.io KAN OUIVIRACH
37

Lesson Learned from Using Docker Swarm at Pronto

Apr 16, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lesson Learned from Using Docker Swarm at Pronto

USING DOCKER SWARM AT PRONTO

L E S S O N L E A R N E D F R O M

www.prontotools.ioK A N O U I V I R A C H

Page 2: Lesson Learned from Using Docker Swarm at Pronto

K A N O U I V I R A C H

A B O U T M E

Research & Development Engineer

Page 3: Lesson Learned from Using Docker Swarm at Pronto

D O C K E R S W A R M

Page 4: Lesson Learned from Using Docker Swarm at Pronto
Page 5: Lesson Learned from Using Docker Swarm at Pronto
Page 6: Lesson Learned from Using Docker Swarm at Pronto

M I C R O S E R V I C E S

https://www.nginx.com/blog/introduction-to-microservices/

Page 7: Lesson Learned from Using Docker Swarm at Pronto

. . H O W W E ’ V E S E T U P. .

Page 8: Lesson Learned from Using Docker Swarm at Pronto
Page 9: Lesson Learned from Using Docker Swarm at Pronto

docker swarm init

docker network create \ -d overlay \ --subnet=192.168.0.0/24 \ simplesat

Page 10: Lesson Learned from Using Docker Swarm at Pronto

docker service create \ --name survey \ --network simplesat \ survey:stable

docker service update \ --image survey:live survey

Page 11: Lesson Learned from Using Docker Swarm at Pronto

docker swarm join \ --token SWMTKN-1-0nqrebfaz7qc6deimizh4tfqavfq5pam1qt08alxots8w5x9fv-8ii4ina9fm640am99z1tbpfvl \ 192.168.65.2:2377

docker swarm join-token manager

To add a worker to swarm

To add a manager to swarm

Page 12: Lesson Learned from Using Docker Swarm at Pronto

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

Page 13: Lesson Learned from Using Docker Swarm at Pronto

Check-In

BUILD PIPELINE FOR SERVICE 1

BUILD PIPELINE FOR SERVICE 2

BUILD PIPELINE FOR SERVICE 3

BUILD PIPELINE FOR SERVICE 4

Page 14: Lesson Learned from Using Docker Swarm at Pronto
Page 15: Lesson Learned from Using Docker Swarm at Pronto

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

Page 16: Lesson Learned from Using Docker Swarm at Pronto

Check - In

Static Analysis

Unit Tests

Build & PushPush

Deploy Production

Pull

Deploy DevPull

Page 17: Lesson Learned from Using Docker Swarm at Pronto

– I N S P I R E D B Y Y E L P

Docker Images Versioning for Continuous Delivery

Page 18: Lesson Learned from Using Docker Swarm at Pronto

docker build -t ${package}:${GIT_COMMIT}

docker tag ${package}:${GIT_COMMIT} ${package}:unstable

During the first docker build

Page 19: Lesson Learned from Using Docker Swarm at Pronto

docker tag ${package}:${GIT_COMMIT} ${package}:stable

docker push ${package}:${GIT_COMMIT} docker push ${package}:stable

After the tests pass

Page 20: Lesson Learned from Using Docker Swarm at Pronto

docker tag ${package}:${GIT_COMMIT} ${package}:live

docker push ${package}:live

After deployment succeeds

Page 21: Lesson Learned from Using Docker Swarm at Pronto

. . W H AT W E ’ V E L E A R N E D . .

http://bocabraincenter.com/conditions/learning-disabilities/

Page 22: Lesson Learned from Using Docker Swarm at Pronto

Follow the practices

• One process per one container • Use an appropriate base image (official base

image)

Page 23: Lesson Learned from Using Docker Swarm at Pronto

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/'

Page 24: Lesson Learned from Using Docker Swarm at Pronto

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

Page 25: Lesson Learned from Using Docker Swarm at Pronto

– E A S Y T O M A I N TA I N

Keep services in one single repository

Page 26: Lesson Learned from Using Docker Swarm at Pronto

Environment variables

– ALLOW US TO HAVE SAME IMAGE ON ALL KINDS OF SERVERS

Page 27: Lesson Learned from Using Docker Swarm at Pronto

D O C K E R S W A R M

couldn’t automatically pull images from private registry when update a service

Page 28: Lesson Learned from Using Docker Swarm at Pronto

--with-registry-auth

Ex. docker service update --with-registry-auth --image simplesat-gateway:cc01ef0c gateway

Page 29: Lesson Learned from Using Docker Swarm at Pronto

(A bit) complex command

Page 30: Lesson Learned from Using Docker Swarm at Pronto

. . W H AT W E P L A N . .

https://unsplash.com/photos/CkH1Hh8kllA

Page 31: Lesson Learned from Using Docker Swarm at Pronto

Monitoring

Page 32: Lesson Learned from Using Docker Swarm at Pronto

Log centralization

Page 33: Lesson Learned from Using Docker Swarm at Pronto

Docker images versioning management

Page 34: Lesson Learned from Using Docker Swarm at Pronto

More integration tests

Page 35: Lesson Learned from Using Docker Swarm at Pronto

Questions?

Page 36: Lesson Learned from Using Docker Swarm at Pronto

www.facebook.com/girlswhodev/

Page 37: Lesson Learned from Using Docker Swarm at Pronto

We are hiring!https://www.prontomarketing.com/company/careers/