42
DevOps workflow with Docker on AWS Nov 19 2016 @Wayarmy – [email protected] Topica Edumall SysAdmin

Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Embed Size (px)

Citation preview

Page 1: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

DevOps workflow with Docker on AWS

Nov 19 2016

@Wayarmy – [email protected] Topica Edumall SysAdmin

Page 2: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

About me

• @wayarmy • Interested: Cloud Computing, AWS, Docker,

IaaS, SaaS, PaaS, Apache Stack, Elastic Stack, Hashi Stack, Ruby on Rails, Linux, Unix…

• Github: http://github.com/wayarmy • Sysadmin, SysOps, DevOps, HumanOps

Page 3: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

1. DevOps

2. CI - CD 3. System Design with Docker on AWS 4. CI - CD workflow with Docker5. Q&A

Techtalk AWS and Docker

Page 4: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

DEVOPS

• DevOps is the practice of operations and development engineers participating together in the entire service lifecycle, from design through the development process to production support. https://theagileadmin.com

Page 5: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

DevOps requirement

• DevOps Skills • Program Language, Application design... • Knowhow about system design • Experience with SaaS, PaaS, IaaS... • Knowhow about Cloud Computing,

Virtualization. • Knowhow about concept of CI - CD

Page 6: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

1. DevOps 2. CI - CD 3. System Design with Docker on AWS 4. CI - CD workflow with Docker5. Q&A

Techtalk AWS and Docker

Page 7: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Continous Intergration

• Continuous integration (CI) is the practice of merging all developer working copies to a shared mainline several times a day. - Wiki Pedia -

• Implement: • Source code managerment • Automation testing • Automation QA • Automation releasing

Page 8: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Continous Delivery

• Continuous delivery (CD) is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time

• - Wiki Pedia -

Page 9: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Target

• Optimize released-time of Production. • Optimize Dev workflow. • Decrease number of tester - Optimize business

benefit.

Page 10: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

1. DevOps 2. CI - CD 3. System Design with Docker on AWS

4. CI - CD workflow with Docker5. Q&A

Techtalk AWS and Docker

Page 11: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Difficulty of DevOps in System

• So hard to get experience with physical, network • So difficult to know all SaaS, PaaS, IaaS... • Everything with Dev is code, everything with

developer will be moved to code • So difficult to maintain software=> System need "write once, run forever"

Page 12: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Topica Edumall (old) System Design

Page 13: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 14: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

AWS EC2 Feature

• Autoscale • High Availability • Secure

Page 15: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Edumall Infrastructure System Design on AWS

Page 16: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 17: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 18: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 19: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 20: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 21: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 22: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 23: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 24: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 25: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 26: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 27: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Benifit

• High availability system • Easy with scale and everything will be automated • Auto healing • Save much money ( save about 40% with 100%

running application on AWS )

Page 28: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Difficult with DevOps

• Server is not transparent with Dev • Deploy with Command line, get error when

deploy • Application environment is not isolate • Deploying is not automation • Hardware is still get high, cannot optimize

Page 29: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Difficult with DevOps

• Server is not transparent with Dev • Deploy with Command line, get error when deploy • Application environment is not isolate • Deploying is not automation • Hardware is still get high, cannot optimize

=> Need a system with isolate environment and orchestration tools for platform

Page 30: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Docker

• Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.

• Build – Ship – Run • Build once, run any where

Page 31: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Kubernetes

• Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.

• “Write once, run forever” • Build Auto-scale and self-healing system

Page 32: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Final Design

Page 33: Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Page 34: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Some numbers

• Video content transfer: 1,5 TB (/1 day) • Static Content (image, js, html, css): 100GB • Total Request: ~ 5 mil • Total Ram: ~ 2TB • Total CPU: ~400vCpus • Unique Visitor: ~50k • Total User: ~20m • Maximum Unique Visitors: ~5k • EC2 Start: ~ 5 (M4 2xLarge)

Page 35: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Techtalk AWS and Docker

1. DevOps 2. CI - CD 3. System Design with Docker on AWS 4. CI - CD workflow with Docker 5. Q&A

Page 36: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Target

• Server is transparent with Dev • PaaS • Everything is Automation • Easy with operation • Document as Code

Page 37: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Element

• Source code managerment: Gitlab • CI builder: Gitlab multi runner • Platform: Docker • Docker registry: Private registry store on AWS S3, ECR • Provisioning: Gitlab runner / Ansible (Near future)

Page 38: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

CI-CD workflow

Developer push a new commit to gitlab

Gitlab Trigger Gitlab Runner fetch and pull repo

Gitlab-runner build Docker image from Dockerfile

Excute test on all target With all environment

Delivery images to Docker hub Or Private registry

Deploy to K8s Cluster

Page 39: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Sumary

• DevOps workflow with AWS IaaS, Kuberntes, Gitlab... • Isolate application environment with Docker • Increase team productivity • Decrease the number of member in Developer Team,

SysAdmin Team, increase the benefit • Write one, run any where and forever!!!!!!=> Don't care about the system, take care of your health

Page 40: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Techtalk AWS and Docker

1. DevOps 2. CI - CD 3. System Design with Docker on AWS 4. CI - CD workflow with Docker 5. Q&A

Page 41: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Thank You

Page 42: Cloudsolutionday 2016: DevOps workflow with Docker on AWS

Meetup: www.meetup.com/AWS-vietnam FB: www.facebook.com/groups/amazonwebservicevietnamJoin Slack: https://aws-vn.herokuapp.com/