1 of 51

Rancher 從入門到入坑

Miles @ Docker 線上讀書會 2016/11/9

2 of 51

CURRENT

Senior Developer @ 104 Corp.

Volunteer @ DevOps Taiwan

TAG

PHP, Docker, DevOps

3 of 51

Outline

  • Introduction
  • How it works
  • Components
  • Live Demo
  • Conclusion

4 of 51

Introduction

5 of 51

Host

6 of 51

Host

Node

7 of 51

Host

Node

PHP

8 of 51

Host

Node

PHP

Database

9 of 51

Host

Node

PHP

Database

Client

15%

10 of 51

Host

Node

PHP

Database

Client

99%

11 of 51

Host 1

Node

Client

99%

Host 2

PHP

Database

12 of 51

Host 1

Node

Client

Host 2

PHP

Database

13 of 51

Host 1

Node

Client

Host 2

PHP

Database

15%

75%

14 of 51

Host 1

Node

Client

Host 2

PHP

Database

PHP

15 of 51

抽象化

16 of 51

Node

Database

PHP

PHP

PHP

LB

17 of 51

Node

Database

PHP

PHP

PHP

LB

LB

Node

Node

18 of 51

Node

Database

PHP

PHP

PHP

LB

LB

Node

Node

Cluster

19 of 51

20 of 51

Container Orchestration

21 of 51

Cross Host

22 of 51

23 of 51

Features

  • Container Networking by Docker Link
  • Dockerized Service
  • Manage via Web UI / API / CLI
  • Scheduling
  • Manage Kubernetes / Swarm / Mesos

24 of 51

How it works

25 of 51

Rancher Server

HTTP

26 of 51

Host 1

Rancher Server

HTTP

27 of 51

Host 1

Host 2

Host 3

Rancher Server

HTTP

28 of 51

Host 1

Host 2

Host 3

Rancher Server

HTTP

Agent

Agent

Agent

29 of 51

Host 1

Host 2

Host 3

Rancher Server

HTTP

Agent

Agent

Agent

IPsec UDP: 500/4500

30 of 51

Host 1

Host 2

Host 3

Rancher Server

HTTP

Agent

Node

PHP

Agent

LB

Redis

Agent

PHP

Database

31 of 51

Host 1

Host 2

Host 3

Rancher Server

HTTP

Agent

Node

PHP

Agent

LB

Redis

Agent

PHP

Database

32 of 51

Components

33 of 51

Components

  • Stack
  • Service
  • Host
  • Container

34 of 51

Infrastructure

Application

Stack

Service

Container

Host

1

N

N

N

1 N

Client

35 of 51

Infrastructure

Application

Stack

Service

Container

Host

1

N

N

N

1 N

Client

Namespace

Class

Memory

Instance

CPU

Abstract

Implement

36 of 51

Live Demo

37 of 51

Build

Define

Manage

38 of 51

Environment

  • Create Machines
  • Install Docker
  • Rancher Server
  • Rancher Host

39 of 51

Host 1

Host 2

Host 3

Rancher Server

HTTP

40 of 51

Service

  • Create Stack
  • Create Service
  • Create Load Balancer

41 of 51

Node

Database

PHP

PHP

PHP

LB

LB

Node

Node

Cluster

42 of 51

Management

  • Access Control
  • API Key

43 of 51

Conclusion

44 of 51

優點很多,但怎麼開始

45 of 51

直接導入

46 of 51

直接導入

  • 霸王硬上弓
  • 長痛不如短痛
  • 先上測試環境

47 of 51

慢慢導入

48 of 51

慢慢導入

  • 懷柔政策
  • Docker
  • 個人測試空間

49 of 51

Q & A

50 of 51

講者們

決鬥吧

51 of 51

Thanks