up! to docker paas - meetupfiles.meetup.com/13197522/up_to_docker_paas_dockermeetup_050… · up!...

34
UP! TO DOCKER PAAS Ming Jin([email protected] ) March 15, 2015 1

Upload: trinhquynh

Post on 28-Jul-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

UP! TO DOCKER PAAS Ming Jin([email protected])

March 15, 2015 1

Page 2: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

WHO AM I

2

Ming Jin Head of Cloud Solutions of

ThoughtWorks China

Architect, Agile Consulting

Solutions and Consulting on

DevOps & Cloud

Email: [email protected]

Page 3: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

ABOUT THOUGHTWORKS

3500 12 32 Employees Countries Offices

Page 4: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

…to name a few

ABOUT THOUGHTWORKS

Agile Continuous Delivery Selenium CruiseControl

Open Source Lean Enterprise

SIP JRuby

MoCo

Continuous Integration Books

Tech Radar

Page 5: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

AGENDA

¨ Background

¨ Docker 101

¨ GoTo Docker

¨ What We Learned?

5

Page 6: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

Background

6

Page 7: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

SOFTWARE DELIVERY

7

Deployment pipeline Product Manageme

nt Delivery

Team

Product Backlog

Did we build the right thing? What’s next?

feedback

feedback

usage data A/B tests traffic analysis customer feedback

on change

on demand

Is my software production-ready right now?

Page 8: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

‣ Manual Build/Test/Package, trivial and error prone

‣ Different Environments, tools

‣  Lack of release readiness feedback

8

Application Lifecycle

Package Build Deployment

IT Services

Environment Middleware Repository

Virtualization

VM Virtual Network Virtual Disk

Infrastructure

Server Storage Network

‣ Manual Operations are trivial and error prone

‣  Lack of IT asset management

‣  System admin as the bottle neck

‣ Manual deployments of Middleware, DB and etc.

‣ Different configurations for different environments

‣  Couldn’t manage changes in time

‣ Different Technologies and tools

‣  Lack of monitoring of hardware performance

‣ No capacity planning ‣  Couldn’t do HA

IT CHALLENGES

Page 9: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

Cloud Control

Cloud Management

Cloud Service

Infrastructure

Cloud Application

DevO

ps Cloud

IAA

S Cloud

Power Storage X86 Servers Networking

Resource View

VM Virtual Disk Networking Monitoring

Policies Templates Monitoring

ITSM

IDE

DevOps Apps

Service Engine Ticket Policy Engine

BaaS Mobile BigData Database

Elastic Architecture Cloud Services

… …

Code Quality

Continuous

Test

Continuous Deploy …

MIddleware Batch Processing

AppStore Monitor Service Portal …

IT Operation Apps

ITSM

Service Catalog Scheduler

Bare Metal Container

Cloud Engine

GOTO CLOUD STRATEGY

Page 10: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

CASE: CLOUDIFY LARGE INFRASTRUCTURE

A World Leading Software Delivery Consultancy ▫  ~800 employees ▫  +100s of projects

ScaleWorks to manage their whole Infrastructure and provide self-service facility.

Before: ▫ ~100 vSphere ESXi/Hyper-V/XenServer Hosts ▫ ~5T Storage (DAS, NFS, SAN) ▫ ~200 Virtual Networks ▫ ~1000 Virtual Machines (Windows, CentOS,

Ubuntu)

After: ▫ VM Provisioning Lead-Time Shortened to ~3 min ▫ ~60% TCO for VM Creation Eliminated 10

“ScaleWorks help improve the IT efficiency and reduce the service lead time, we’re all happy with it.”

Page 11: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

IAAS CLOUD + DEVOPS

Dev

Tester

•  VM Instance CRUD •  Environment Instance CRUD •  VM Instances over XenServer •  Isolated Windows Domains •  DnsMasq as DNS Proxy

Scenarios: Technologies:

•  ScaleWorks + MySQL •  Puppet + PowerShell

DSC •  WinRM •  Dnscmd •  Windows DC •  DnsMasq •  XenServer

•  Add new Zone on Windows DC •  Create new Instances •  Register Instances to Windows DC •  Configure A-Records/Cnames on

DC •  Configure new Instances •  Version Configurations with PS

DSC

Environment Creation:

Windows DC1

Windows DC2

Web App

DB FC

Env1

CI Agent2

DnsMasq

CI Agent1

PowerShell DSC

ScaleWorks

Local NuGet Repo Git Repo Jenkins

Build Pipeline

Nagios

XenServer

Deployment Pipeline

MySQL

ENV Description

Page 12: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

Cloud is Good, can we do better?

12

Page 13: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

MISMATCH OF IAAS AND APPLICATION

¨  IaaS is VM based, a bit heavy for developers

¨  IaaS is Resource focused, a bit far from Application level

¨ Resource Density is not Efficient ENOUGH

13

Page 14: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

Docker 101

14

Page 15: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

$ sudo apt-get update

$ sudo apt-get install docker.io

$ source /etc/bash_completion.d/docker.io

$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh

Easy to install, easy to start a container: $ docker run -i -t ubuntu /bin/bash  

Use existing container images from docker Hub, or build your own. Expose ports for services running in container, daemonize containers.

DOCKER BASICS

Page 16: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

Fair  use  from  h-p://blog.octo.com/en/docker-­‐registry-­‐first-­‐steps/  

BUILDING DOCKER IMAGES

Page 17: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

CONFIGURING DOCKER IMAGES

Page 18: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

COREOS BASICS

¨ Linux distribution

¨ Rolling upgrades

¨ Minimal OS

¨ Docker support

¨ etcd and fleet tools to manage distributed applications based on containers.

¨ Cloud-init support

¨ Systemd units

18

Page 19: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

KUBERNETES BASICS

¨ Docker application orchestration

¨ Google GCE, rackspace, Azure providers

¨ Deployable on CoreOS

¨ Container replication

¨ HA services

19

Page 20: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

DOCKER: SO FAR THE BEST CHOICE FOR PAAS

20

Web

App

DB

LB

Application Stack

Portability

Productivity

Docker

RPM APT

War NuGet

Gem

VM

Bare Metal

LXC

Solaris Zone KVM

VSphere

Package

Container

PC

Blade

Page 21: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

GoTo Docker Strategy

21

Page 22: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

GOTO DOCKER STRATEGY

¨ Docker-Enabled VM Service

¨ Kubernete-Enabled Stack

¨ Application-Centric Services

22

Page 23: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

GOTO DOCKER: DOCKER-ENABLED VM

¨ CoreOS VM Based Docker Service

¨ Docker REST API integration (SSL)

23

Page 24: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

GOTO DOCKER: COREOS PROVISIONING

24

Page 25: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

GOTO DOCKER: COREOS PROVISIONING

25

Page 26: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

GOTO DOCKER: KUBERNETES-ENABLED STACK

¨ Kubernetes based Docker Cluster Service

¨ Kubernetes REST API integration (SSL)

26

Page 27: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

GOTO DOCKER: KUBERNETES PROVISIONING

¨  ScaleWorks to start nodes with coreOS template

¨  User data to pass cloud-init configs

¨  Master.yaml for Kubernetes Master

¨  Node.yaml for Kubernetes Minions

¨  Start Kube* Service units with SystemD

27

Page 28: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

GOTO DOCKER: APPLICATION-CENTRIC SERVICES

¨ Application Centric Services

¨ Use Dockerfile to Boot/Configure Single Component

¨ Dockerfile Detection

¨ User Topology file to Orchestrate Multiple Components

¨ TOSCA?

¨ App.yml

28

Page 29: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

GOTO DOCKER: APPLICATION-AWARE SERVICES

29

Page 30: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

CASE STUDY: DOCKER PAAS

Dev

Tester

•  Docker based Environment •  Kubernetes as Docker Clustering •  DnsMasq as DNS Proxy •  Iptables routing for VPN Sharing •  VM Instance CRUD •  Environment Instance CRUD

Scenarios: Technologies:

•  ScaleWorks + MySQL •  Puppet •  Kubernetes •  Docker •  DnsMasq + Iptables

Routing •  XenServer + Fedora •  Private Docker Registry

•  Create new Kubernetes Environment

•  Configure Network Settings •  Initiate Docker Cluster •  Configure Docker Instances •  Deploy Applications

Environment Creation:

VLAN

Kubernetes Mater

Network

Ansible

ScaleWorks

Local Docker Registry Git Repo Jenkins

Build Pipeline

Nagios

XenServer

Deployment Pipeline

MySQL

ENV Description

Kubernetes Minion

DnsMasq

iptables

Kubernetes Minion

Controller Scheduler

VPN

Web App Env1 DB

Env2 Web App DB

* https://bitbucket.org/wenbo_liu_tw/dockerpaas * https://bitbucket.org/wenbo_liu_tw/fdockeron

Page 31: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

What We Learned?

31

Page 32: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

LESSONS

¨ Docker is AWESOME!

¨ Build, Ship and Run Any App, Anywhere

¨ High Resource Density

¨ Active Communities and Ecosystem

¨ Easy to Extend / Integrate

¨ API RESTful API/Kubernetes RESTful API

¨ Work Closely with the End Developers

32

Page 33: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

实施DevOps的建议

Keep Refining Best Practices & Better Services

Page 34: UP! TO DOCKER PAAS - Meetupfiles.meetup.com/13197522/UP_to_Docker_PaaS_DockerMeetup_050… · UP! TO DOCKER PAAS Ming Jin ... • Puppet + PowerShell DSC • WinRM • Dnscmd

THANK YOU For questions or suggestions:

Ming Jin

[email protected]