+ All Categories
Home > Documents > Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and...

Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and...

Date post: 05-Sep-2019
Category:
Upload: others
View: 8 times
Download: 0 times
Share this document with a friend
86
Containers and distributed applications Xiang Li Head of distributed system @ CoreOS
Transcript
Page 1: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Containers and distributed applications

Xiang LiHead of distributed system @ CoreOS

Page 2: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Distributed system at CoreOS

We solve hardest distributed system problems

Page 3: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Secure the InternetMission

Page 4: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Make servers easy to upgradeSTRATEGY

Page 5: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

CoreOS Linux

Self updateSeparate OS and the Apps- enforce container oriented deployment

Page 6: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

CoreOS Linux

1000+ releases

Page 7: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Simplify application managementSTRATEGY

Page 8: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

etcd

Configuration managementDistributed coordination

Page 9: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

fleet

Distributed init system

Page 10: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Kubernetes

The “Replacement” for fleet

Manage containerized applications

Page 11: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

On any infrastructureSTRATEGY

Page 12: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

CoreOS Linux

Public cloud- AWS, Azure, GCE, Packet...

Private cloud- OpenStack

Bare mental- iPXE

Page 13: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

flannel

Enabling IP per container on any infrastructure

Page 14: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

CoreOS

Accelerate the industry adoption of containers

Page 15: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Container

Run applications anywhere

Page 16: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Container

Package

Page 17: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Container

Push

Pull

Page 18: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Container

Run

Page 19: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Docker

$ docker build

$ docker push

$ docker run

Page 20: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Container Engine

Manage the lifecycle of a single application

Page 21: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Why CoreOS uses container

Make OS secure

Page 22: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Why CoreOS uses container

Deploy distributed applications

Page 23: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Why Google uses container

Run distributed applications efficiently

Page 24: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Container management

Managing the lifecycle of one application instance is not enough

Page 25: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on one node

Page 26: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on one node

Page 27: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on two nodes

Page 28: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on two nodes

Page 29: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on a cluster

Where to put my containers?

Page 30: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on a cluster

How to find my containers?

Page 31: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on a cluster

How to connect to my containers?

Page 32: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on a cluster

Scheduler

Page 33: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on a cluster

Scheduler

Page 34: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Scheduler

Running containers on a cluster

Page 35: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on a cluster

color=yellow

Page 36: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on a cluster

Select color = yellowcolor=yellow

Page 37: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on a cluster

yellow.myclusterSelect color = yellow

Page 38: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Running containers on a cluster

- Application deployment- Replication controller- Rolling upgrades- Auto scaling

- Configuration and secret- Resource management

- Storage- Network

Page 39: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

GIFEE

Google infrastructure for everyone else - A flexible, secure, reliable infrastructure for running distributed applications.- CoreOS

Page 40: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Application developers

I hate dealing with operations!

Page 41: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Application developers

Run my application on a “cluster manager” now!

Page 42: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Trust us!

System builders

Page 43: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Operators

Here is Kubernetes!

Page 44: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Operators

Here is Kubernetes! Docker Swarm DC/OS

Page 45: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

But …

Can your applications run smoothly on the cluster manager?

Page 46: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Cloud native application

Distributed Stateless

Page 47: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Distributed and stateless

Scale

Page 48: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Distributed and stateless

Fault tolerance

Page 49: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Distributed and stateless

Easy to operate

Page 50: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Stateless

No dependency on local resources

Page 51: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Stateless

Treat storage as services

Page 52: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Stateless

Store configuration in the environment

Page 53: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Managed stateless applicationSpec

- Container: example.com/myApp?version=1- Replica: 3- Restart: Always

Page 54: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Distributed and statelessSpec

- Container: example.com/myApp?version=1- Replica: 3- Restart: Always

Page 55: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Distributed and statelessSpec

- Container: example.com/myApp?version=1- Replica: 3- Restart: Always

Page 56: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Distributed and statelessSpec

- Container: example.com/myApp?version=1- Replica: 3- Restart: Always

Page 57: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Stateful application

Page 58: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Stateful applicationWhere is my data?

Page 59: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Stateful application

Fully managed by humanOr semi-fully managed by human

Page 60: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Container 2.0

Container 2.0 is the ability to run (and orchestrate) both stateless and stateful services on the same set of resources. - Mesosphere

Page 61: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clusters

etcd- Clustered key-value store- Writes are persisted on disk- Writes are replicated to all nodes

Page 62: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clusters

Tightly coupled with local storage

WALSnapshot

Page 63: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clusters

Indirectly coupled with local storage of it peers

WALSnapshot

Page 64: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clusters

Strong membership

Page 65: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clusters

Strong membership

???

Page 66: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clusters

External controller- A big for loop to simulate human operator

- Manage data migration- Manage membership changes- Manage configuration changes

Page 67: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersBootstrap a 3 member cluster

controller

Page 68: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersBootstrap a 3 member cluster

controller

Page 69: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersBootstrap a 3 member cluster

controller

Add member

Page 70: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersBootstrap a 3 member cluster

controller

Page 71: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersBootstrap a 3 member cluster

controller

Page 72: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersBootstrap a 3 member cluster

controller

Page 73: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersResize from 3 to 5

Select app = etcdAdd member if size < 5 controller

Add member

Page 74: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersResize from 3 to 5

Select app = etcdAdd member if size < 5 controller

Page 75: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersResize from 3 to 5

Select app = etcdAdd member if size < 5 controller

Page 76: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersFailure recovery

Select app = etcd controller

Page 77: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersFailure recovery

Select app = etcdRemove dead one

controller

Remember

Page 78: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersFailure recovery

Goto resize controller

Page 79: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersFailure recovery

Select app = etcd controller

Page 80: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Example: manage etcd clustersBackup

- Sidecar pattern controller

Page 81: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Stateful distributed application

More controllers to replace human

Page 82: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Tips for building distributed application

Use coordination libraries/softwares- Leader election- Locking- Queue- Barrier

Page 83: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Tips for building distributed application

Use a RPC framework- strict contract between components- across languages support- client side load-balancing- client side naming resolution- auth

Page 84: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Tips for building distributed application

Metrics- Request rate/duration- Error rate- Internal state

Page 85: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Tips for building distributed application

Logging- Human actionable events- Critical State changes

Page 86: Head of distributed system @ CoreOS Xiang LiŽ響... · CoreOS Linux Self update Separate OS and the Apps - enforce container oriented deployment

Future is bright


Recommended