containerdayvietnam2016: hybrid and automation system architecture

33
Hybrid and Automation System Architecture @Author: Quanpc - [email protected] System Administrator From: Topica Edumall

Upload: docker-hanoi

Post on 12-Apr-2017

193 views

Category:

Technology


0 download

TRANSCRIPT

Hybrid and Automation System Architecture

@Author:Quanpc - [email protected] AdministratorFrom:Topica Edumall

SomeproblemwithOPs

• Physicalsystemissohardtoscale• Conflictwithapplicationsenvironment• ConflictbetweenDevelopersandSysadmin• ….• =>Needasolutionstocontrolandsolve all problem

Automation Workflow and Hybrid System

• ReleaseRailsAppwithGitlab whenappliedDocker• (CI– CDworkflowwithRailsAppwhenapplyDocker)

• Designauto-scalesystemwithDockeronKubernetesandAWSCloud• ScalablesystemwhenusingonlyAWSCloud• Auto-scalesystemonKubernetesandAWSCloud

Dockerize RailsApps

- Dockerfile- EnvironmentVariables- Gem requirement- Specify Gem with Gemfile and

Gemfile.lock

Gitlab-CI & Gitlab-multi-runner

- Autotest- AutoQ/A- MultipleEnvironmentTesting- AutoReleaseImages- AutodeliveryDockerImagestoDocker-Hub- Autodeployment

CI-CDworkflowwithDocker

Developerpushanewcommittogitlab

Gitlab Trigger Gitlab Runnerfetchandpullrepo

Gitlab-runnerbuildDockerimagefromDockerfile

ExcutetestonalltargetWithall“RAILS_ENV”

DeliveryimagestoDockerhubOrPrivateregistry

DeploytoK8sCluster

CI– CDworkflowwithDev

• DeveloperwriteDockerfileandpushesthecommittoGitlab• GitlabnotifyGitlab-runnerbytrigger• Gitlab-runnerfetchandpullrepo,buildDockerImagewithDockerfile• Gitlab-runnerruncontainerwithcommandtest,andallRAILS_ENV,environmentspecifyonconfigfile

• IFthispassalltest-case,itwillbepushedtodockerhubordockerprivateregistry• Afterthat,Gitlab-runnerwillrollingupdatepods,service,replicationcontrolleronK8sClusterwithnewdocker-images

Auto-scalesystemwithDockerandKubernestesonAWS

HybridAuto-scalesystemonAWS

Auto-Scaling

• Makethesystemeasierwithscalable• Alltheactionswith automation• Policy scale-up and scale-down

AutoHealing

• Auto define unexpected event of infrastructure• Auto fix

KubernetesArchitecture• Kubernetes isanopen-sourcesystemforautomatingdeployment,scaling,andmanagementofcontainerizedapplications.

• “Writeoncerunforever”

Features focus• Pods• Replication Controller • Services• LBaaS• HPA – Horizontal Pods Autoscaling• Constraint• Label• Namespace• …

HybridsystemArchitecture

• DEV:• MakeITsimple• Easytouse• DocumentsasCode• Notneedtosetup

• OPS• Easytomaintain• Becomehumanops

Disadventage

• Workflow: • Developer must know about system – Devops • Can’t apply docker to all old services• Dockerize old big system is so hard• Personal know-how

YOUR GOAL• Hybrid system with HA, AUTO-HEALING, AUTO-SCALING, AUTO-

DEPLOYMENT…• Easy with “OPS”• Easy with “DEV”

Q&A