containerdayvietnam2016: hybrid and automation system architecture
TRANSCRIPT
Hybrid and Automation System Architecture
@Author:Quanpc - [email protected] AdministratorFrom:Topica Edumall
SomeproblemwithOPs
• Physicalsystemissohardtoscale• Conflictwithapplicationsenvironment• ConflictbetweenDevelopersandSysadmin• ….• =>Needasolutionstocontrolandsolve all problem
• 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-Scaling
• Makethesystemeasierwithscalable• Alltheactionswith automation• Policy scale-up and scale-down
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”