제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Ranchers
-
Upload
tommy-lee -
Category
Technology
-
view
282 -
download
8
Transcript of 제4회 한국IBM과 함께하는 난공불락 오픈소스 인프라 세미나-Ranchers
난공불락 세미나
2017. 05.25
Rancher for Continuous DeliveryDevOps Korea Group
이미지 출처: http://www.swanlandco.com/properties/sun-river-ranch
Ralf Yang
Intro…DevOps Korea Group
Speaker
• Ralf Yang = DevOps, Technical Architect
• Since 2004 ~ - Startup company System Engineer - NHN Services Operations - Yahoo! Korea Service Engineer - EstSoft, Zum.com System Admin - Dell international Enterprise Tech. Support Sr. Analyst - GS SHOP Technical Architect - code post (현)
http://ralfyang.com
Speaker
• 활동
- Open-source committer: • Zinst, Zinst packages, Cloud-dashboard, Docker-Cli-Dashboard etc. • https://zinst.me
- FaceBook DevOps Korea Group Admin • https://www.devopskorea.com
- With Monty: Father of MySQL - - With Joshua: God Father of OpenStack - - With Patrick McGarry: Director of Ceph Community -
Tools
-준비물
•VirtualBox
•Vagrant
•Docker
- Docker-compose
•Rancher
- Cattle •Git
•Docker Cli-dashboard
http://zinst.me
Rancher 기반의 Container OrchestrationDevOps Korea Group
Docker ?
•LXC(Linux Container) - Host server의 Kernel을 공유 -> 별도의 Booting 과정이 없다 - Docker-image를 online registry(Repository 개념)에서 바로 받아 올 수 있다
•Default registry: hub.docker.com
•private registry: ex) private.registry.ralfyang.com/centos:6.5 - Docker image 내부에 독집적인(isolated) Runtime 환경을 별도로 만들어서 전달 할 수 있다
Docker-compose ?
•Docker compose ? : Provisioning set file for docker container
•ex) https://github.com/goody80/SolrCloud_docker_compose
이미지 출처: https://blog.docker.com/media/2015/11/logo-title-final-compose-2b.png
Docker Cli-Dashboard
•DCS
•https://github.com/goody80/docker_cli_dashboard
Rancher Test 환경 구축 하기: Vagrant + VirtualBox
•Manual
•https://github.com/goody80/vagrant_rancher_cluster
•Virtual Box install
•https://www.virtualbox.org/wiki/Downloads
•Vagrant install
•https://www.vagrantup.com/downloads.html
•Box(Virtual Machine OS image) add
•$] vagrant box add ubuntu1404 https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box
•Source Pull
•$] git clone https://github.com/goody80/vagrant_rancher_cluster.git
Vagrant 이해하기
•Vagrantfile
•Vagrant file구조
i 값은 0~9까지, 10개의 instance가 hostname을 기반으로 생성되는 영역
ex) vagrant up vmhost01 && vagrant up vmhost02
vagrant up rancher 라고 입력 했을 시 사용되는 영역
vagrant default setting
Github: https://github.com/goody80/vagrant_rancher_cluster
Vagrant 이해하기
•Provisioning script review
Github: https://github.com/goody80/vagrant_rancher_cluster
Vagrant 이해하기
•Provisioning script review: default_setting.sh
Github: https://github.com/goody80/vagrant_rancher_cluster
Vagrant 이해하기
•Provisioning script review: rancher.sh
Github: https://github.com/goody80/vagrant_rancher_cluster
Vagrant 이해하기
•Provisioning script review: vmhost.sh
Github: https://github.com/goody80/vagrant_rancher_cluster
Vagrant 사용하기
•VM create by Vagrant provisioning
-$] cd vagrant_rancher_cluster; vagrant up rancher
Github: https://github.com/goody80/vagrant_rancher_cluster
Rancher server 시작하기
•vagrant ssh rancher
•Rancher server install: - https://docs.rancher.com/rancher/v1.5/en/installing-rancher/installing-server -mkdir /vagrant/rancher_db; sudo docker run -d -v /vagrant/rancher_db/mysql/:/var/lib/mysql --restart=unless-stopped -p 8080:8080 rancher/server
•http://localhost:8080
Rancher 둘러보기
Rancher Host server provisioning
•VM create by Vagrant provisioning
-$] cd vagrant_rancher_cluster; vagrant up vmhost01
Rancher Host server provisioning
Youtube link : https://youtu.be/MSPWbT7Tblo
-$] cd vagrant_rancher_cluster; vagrant up vmhost01
Rancher Host pool 하나 더! 추가하기
Youtube link : https://youtu.be/2fI2zVkd_lg
Admin 계정 설정 & Catalog를 통한 Service 생성하기
Youtube link : https://youtu.be/rRRor2lq5yo
Docker-compose를 통한 Service Stack 생성하기
Youtube link : https://youtu.be/LssSF7-Borc
Hands on
•Provisioning by Docker-compose
•vagrant ssh vmhost01
•$] sudo -i
•$] cd /data/source; git clone https://github.com/goody80/docker-elk
•Stack add by docker-compose.yml
•Make a Load-Balancing group
•Try to scale-up
Tips
•Rancher server-HA
•http://docs.rancher.com/rancher/v1.4/en/installing-rancher/installing-server/#multi-nodes
•Script for HA setting
•https://github.com/goody80/rancher_server_ctl/blob/master/rancher-ha
•Manual Upgrade
•https://docs.rancher.com/rancher/v1.5/en/upgrading/#single-container
•RELEASING THE DATABASE LOCK
•https://docs.rancher.com/rancher/v1.1/en/faqs/server/#databaselock
쉬어가는 페이지
Rancher 기반의 Continuous DeliveryDevOps Korea Group
Dev. Staging Production
CI/CD 진행방향 예시
https://en.wikipedia.org/wiki/Continuous_delivery
2 cycle (Staging)
1 cycle (Dev.)
Artifact
3 cycle (Staging)
Artifact
Developer (Requester)
I Need a Wordpress!
DevOpsfor CD
OK, Hold on..
Find a base image for wordpress- rhel-wordpress-html-embed- rhel-mysql-4gb
Docker registry
Docker run
Hostrhel-wordpress-html-embed
rhel-mysql-4gb
Hostrhel-wordpress-html-embed
rhel-mysql-4gb
Hosthaproxy
haproxy
Logstash
HostElastic Search
Kibana
logspout logspout
BCP
Load balancing
HA
Service On
Log collector
Agent for event stream log
Log gathering
ELK Metric Dashboard
cAdvisor
cAdvisor
cAdvisor cAdvisor
Requirement for Container Automation: - Scale out/in - Rolling upgrade - Security - Volume mount - Backup - Service discovery - Load balancing - Routing
컨테이너 기반의 Service Delivery 체계 구축 예시
Bakery for Base-image
Docker Base image build pipeline
Bakery for CI
Docker Base image + Source build pipeline
Source Build automation Part
12factor
•https://12factor.net/ko/
•https://12factor.net
•Disposability
Continues Delivery를 왜 해야 하는가? (1/2)
-배포 업무 성숙도 향상
•무중단 배포 -> 지속적인 배포 -> 빠른 개발 빠른 출시
•Dev. = Stage = Production -> 충분한 테스트 -> 배포에 따른 문제 최소화
•Human error 예방
-전략적 배포 기법
•Canary release -> Soft-landing
•Blue/green deployment
•AB Test -> UX -> Service 만족도 향상
Blue-green Deployments, A/B Testing, and Canary Releases: http://blog.christianposta.com/deploy/blue-green-deployments-a-b-testing-and-canary-releases/
Continues Delivery를 왜 해야 하는가? (2/2)
-장애대응
•빠르고 정확한 장애진단 및 복구
-서비스 상황 대응
•Scale-out/in
•빠르고 정확한 롤백
-보안
•네트워크 분리
•접근제어
쉬어가는 페이지
QnA
감사합니다 :)