Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2016-09-21 Rancher 傻瓜也會用的容器集群管理

Sammy Lin
September 20, 2016

2016-09-21 Rancher 傻瓜也會用的容器集群管理

隨著 Docker Swarm、Kubernetes、Mesos 等工具的成熟,容器集群管理早已是 Container 界的兵家必爭之地,然其實除了前述的工具之外,你還有另一個新選擇 - Rancher。Rancher 1.0 已正式推出,打著比他牌工具相對容易安裝、部署、操作及混用的招牌,試圖要在 Container 企業用戶市場中搶占一席之地。這場分享將會示範如何透過 Rancher 提供的 CLI 來實現 Continuous Delivery,透過實際 DEMO 讓我們一起瞧一瞧究竟 Rancher 的魅力何在。

Sammy Lin

September 20, 2016
Tweet

More Decks by Sammy Lin

Other Decks in Technology

Transcript

  1. *OTUBMMJOH3BODIFS4FSWFS 4JOHMF/PEF #*/%.06/5.:42-70-6.& $ sudo docker run -d -v $(pwd)/mysql:/var/lib/mysql

    \
 --restart=unless-stopped \
 -p 8080:8080 \
 rancher/server $ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server
  2. *OTUBMMJOH3BODIFS4FSWFS 4JOHMF/PEF #*/%.06/5.:42-70-6.& 64*/("/&95&3/"-%"5"#"4& $ sudo docker run -d --restart=unless-stopped

    -p 8080:8080 \ -e CATTLE_DB_CATTLE_MYSQL_HOST=<hostname or IP of MySQL instance> \ -e CATTLE_DB_CATTLE_MYSQL_PORT=<port> \ -e CATTLE_DB_CATTLE_MYSQL_NAME=<Name of Database> \ -e CATTLE_DB_CATTLE_USERNAME=<Username> \ -e CATTLE_DB_CATTLE_PASSWORD=<Password> \ rancher/server $ sudo docker run -d -v $(pwd)/mysql:/var/lib/mysql \
 --restart=unless-stopped \
 -p 8080:8080 \
 rancher/server $ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server
  3. *OTUBMMJOH3BODIFS4FSWFS 4JOHMF/PEF #*/%.06/5.:42-70-6.& 64*/("/&95&3/"-%"5"#"4& $ sudo docker run -d --restart=unless-stopped

    -p 8080:8080 \ -e CATTLE_DB_CATTLE_MYSQL_HOST=<hostname or IP of MySQL instance> \ -e CATTLE_DB_CATTLE_MYSQL_PORT=<port> \ -e CATTLE_DB_CATTLE_MYSQL_NAME=<Name of Database> \ -e CATTLE_DB_CATTLE_USERNAME=<Username> \ -e CATTLE_DB_CATTLE_PASSWORD=<Password> \ rancher/server $ sudo docker run -d -v $(PWD)/mysql:/var/lib/mysql \
 --restart=unless-stopped \
 -p 8080:8080 \
 rancher/server $ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server
  4. 3BODIFS 4FSWFS 
 3BODIFS )PTU 
 3BODIFS )PTU 
 3BODIFS

    )PTU Rancher Agent
 (Docker) Rancher Agent
 (Docker) Rancher Agent
 (Docker)
  5. "EE)PTUT $VTUPN)PTUT $ sudo docker run \
 -d \
 --privileged

    \ -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v1.0.2 \ http://<rancher-server-ip>:8080/v1/scripts/<registrationToken>
  6. Stack Rancher Load Balancer APP Redis Network Agent Network Agent

    Network Agent Through IPsec (UDP 500 & 4500) APP
  7. Stack Rancher Load Balancer APP Redis Network Agent Network Agent

    Network Agent Through IPsec (UDP 500 & 4500) APP
  8. 3BODIFS$PNQPTF5PPM 4FUUJOHVQ $ export RANCHER_URL=http://<server_ip>:8080/v1 $ export RANCHER_ACCESS_KEY=<accessKey_of_account_api_key> $ export

    RANCHER_SECRET_KEY=<secretKey_of_account_api_key> $ wget https://github.com/rancher/rancher-compose/releases/ download/v0.8.6/rancher-compose-linux-amd64-v0.8.6.tar.gz $ tar zxvf rancher-compose-linux-amd64-v0.8.6.tar.gz $ cd rancher-compose-v0.8.6 $ ./rancher-compose *OTUBMM VCVOUV
  9. $*$%'MPX DPNNBOEQ AWS S3 Docker Registry Docker Push Jenkins Trigger

    Git Push Docker Build Rancher Deploy Proxy Server Rancher (China) Docker Pull
  10. 3FGFSFODF Rancher Official Website: http://rancher.com/ Rancher Tutorials: http://rancher.com/learn/
 GO Simple

    Tunnel(Gost): https://github.com/ginuerzh/gost
 Gost (Docker): https://github.com/pahud/gost-docker