container orchestration on_aws

75
Container orchestration on AWS by Kasper Nissen @phennex

Upload: kasper-nissen

Post on 22-Jan-2018

299 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Container orchestration on_aws

Container orchestration on AWS

by Kasper Nissen @phennex

Page 2: Container orchestration on_aws

Hi! My name is Kasper

@phennex

Page 3: Container orchestration on_aws
Page 4: Container orchestration on_aws
Page 6: Container orchestration on_aws

@phennex

Page 7: Container orchestration on_aws

@phennex

AGENDA1. Containers

2. Container Orchestration

3. Options?

4. Implementations?

5. Demo (rancher & kops)

Page 8: Container orchestration on_aws

CONTAINERS

@phennex

what? why?

Page 9: Container orchestration on_aws

@phennex

“… The value of this utilitarian object lies not in what it is, but in how it is used. The

container is at the core of a highly automated system for moving goods from anywhere, to anywhere, with a minimum of

cost and complication on the way.”–Marc Levinson

Page 10: Container orchestration on_aws

@phennex

TEXT

A

B

illustrations from:

Page 11: Container orchestration on_aws

@phennexillustrations from:

Page 12: Container orchestration on_aws

@phennexillustrations from:

Page 13: Container orchestration on_aws

@phennex

Multiplicity of goods

Multiplicity of methods for transport/storing

illustrations from:

Page 14: Container orchestration on_aws

@phennexillustrations from:

Page 15: Container orchestration on_aws

@phennex

Multiplicity of stacks

Multiplicity of hardware environments

illustrations from:

Static websitenginx 1.5 + mod security + openssl + bootstrap 3

User DBpostgresql + pgv8 + v8

Background workersPython 3.0 + celery + pyredis + libcurl + ffmpeg +

libopencv + nodejs + phantomjs

API endpointPython 2.7 + Flask + pyredis + celery + psycopg + postgresql-client

Public cloud

Production cluster

Customer Data Center

Development Laptop

Contributor’s desktop

Web frontendRuby + Rails + sass + Unicorn

Page 16: Container orchestration on_aws

Host OS

OS

Runtime

App

Container

@phennexillustrations from:

Dev Ops

Page 17: Container orchestration on_aws

@phennex

Host OS

OS

Runtime

App

Container

OS

Runtime

App

Container

OS

Runtime

App

Container

Multiple containers on the same host

Page 18: Container orchestration on_aws

@phennex

prometheus: image: quay.io/prometheus/prometheus links: - node-exporter:nodeexporter grafana: image: grafana/grafana links: - prometheus:prometheus node-exporter: ports: - 9100:9100/tcp image: prom/node-exporter

docker-compose

Page 19: Container orchestration on_aws

@phennex

Host OS

Container

Elastic Load Balancer

Container

Container

Host OS

Container Container

Container

Host OS

Container Container

Container

Replicated setup

Page 20: Container orchestration on_aws

@phennex

WHAT DO WE NEED?

Page 21: Container orchestration on_aws

@phennex

Scheduling

Page 22: Container orchestration on_aws

@phennex

Resource optimization

Page 23: Container orchestration on_aws

@phennex

Consensus

Page 24: Container orchestration on_aws

@phennex

Resilience

Page 25: Container orchestration on_aws

@phennex

Scalability

Page 26: Container orchestration on_aws

@phennex

CONTAINER ORCHESTRATION

Page 27: Container orchestration on_aws

@phennex

Node Node Node Node Node Node Node

Node NodeNode Node Node Node Node

big dataapp Bapp A database

… maybe a node we forgot about…

The reality?

Page 28: Container orchestration on_aws

@phennex

Node Node Node Node Node

Node Node Node Node Node

big dataapp Bapp A database

The dream

datacenter

Cluster Manager

Page 29: Container orchestration on_aws

@phennex

CATTLE VS PETS

Page 30: Container orchestration on_aws

@phennex

WHAT OPTIONS DO WE HAVE?

Page 31: Container orchestration on_aws

@phennex

Docker Swarm Kit

Page 32: Container orchestration on_aws

@phennex

Master

Pluggable Executor

Agent

Pluggable Executor

Agent

Pluggable Executor

Raft Consensus

(Leader election)

Docker Swarm Kit

Docker Engine

TaskService

Submit a task

Execute the task

Page 33: Container orchestration on_aws

@phennex

Docker Swarm Kit

docker service create --replicas 1 --name helloworld alpine

docker service ls

Page 34: Container orchestration on_aws

@phennex

You like using the docker CLI, and ecosystem tools

Get the native Docker API experience and compatibility

Easy to setup

Why Docker Swarm Kit?

docker swarm init

docker swarm join

Page 35: Container orchestration on_aws

@phennex

Controlled by Docker Inc.

Fairly new (Launched at DockerCon 2016)

Why NOT Docker Swarm Kit?

Page 36: Container orchestration on_aws

@phennex

APACHE MESOS

Page 37: Container orchestration on_aws

@phennex

ZooKeeperZooKeeper

ZooKeeper

Service 1Service 1Mesos Master

Service 1Service 1MarathonCoordination

& Configurations

Long running tasks

JobsMesos Slaves

Apache Mesos

Page 38: Container orchestration on_aws

@phennex

You are a Big Data house

You have a lot of job oriented or task oriented workloads

You have an infrastructure team

Your IT department employs a team of distributed systems specialists

You want to schedule multiple giant workload types concurrently

Maybe you will run Hadoop, Marathon, and Chronos all together

You have a 10.000+ node cluster

Cluster design is extremely scalable, and easily supports thousands of nodes

Battleprooved (Twitter, AirBnB, Uber)

Why Apache Mesos?

Page 39: Container orchestration on_aws

@phennex

Requires a lot of management (2 layers, Mesos and the frameworks)

Too big for many use cases?

Why NOT Apache Mesos?

Page 40: Container orchestration on_aws
Page 41: Container orchestration on_aws
Page 42: Container orchestration on_aws

@phennex

KUBERNETES

Page 43: Container orchestration on_aws

@phennex

KubernetesBased on Google’s 10 years of experience with Borg

Designed for containers

Declarative definition of desired state

Modular

Built with fault tolerance and resilience in mind

Govern by CNCF (Cloud Native Computing Foundation)

Page 44: Container orchestration on_aws

@phennex

Kubernetes

Scheduler

API Server

Kubernetes master

Kubelet Kubelet Kubelet

Application containers

Nodes

Page 45: Container orchestration on_aws

@phennex

Pods

Pod

Web server

Container

Pod

Web server

Container

Git sync

Container

Git repoConsumers Consumers

Page 46: Container orchestration on_aws

@phennex

Services

Pod

Web server

Container

Pod

Web server

Container

Pod

Web server

Container

type=FE type=FE type=FE

Service

VIP

Label selector: type=FE

Consumers

Page 47: Container orchestration on_aws

@phennex

Labels

Pod

Container

type=FE

Pod

Container

type=FE

Pod

Container

version=2

version=2

Dashboard Dashboard

show: type=FE show: version=v2

Page 48: Container orchestration on_aws

@phennex

Deployment (Replica Set)

Pod

Container

type=FE

Pod

Container

type=FE

Pod

Container

type=FE

Current: 3 Desired: 3

version=2 version=2 version=2

Deployment

Page 49: Container orchestration on_aws

@phennex

Deployment (Replica Set)

Pod

Container

type=FE

Pod

Container

type=FE

Pod

Container

type=FE

Current: 3 Desired: 3

version=2 version=2 version=2

Deployment

Pod

Container

type=FE

version=3

New version

Page 50: Container orchestration on_aws

@phennex

Deployment (Replica Set)

Pod

Container

type=FE

Pod

Container

type=FE

Pod

Container

type=FE

Current: 3 Desired: 3

version=3 version=2 version=2

Deployment

Page 51: Container orchestration on_aws

@phennex

Deployment (Replica Set)

Pod

Container

type=FE

Pod

Container

type=FE

Pod

Container

type=FE

Current: 3 Desired: 3

version=3 version=3 version=2

Deployment

Page 52: Container orchestration on_aws

@phennex

Deployment (Replica Set)

Pod

Container

type=FE

Pod

Container

type=FE

Pod

Container

type=FE

Current: 3 Desired: 3

version=3 version=3 version=3

Deployment

Page 53: Container orchestration on_aws

@phennex

Canary (AB testing)

Pod

Container

type=BE

Pod

Container

type=BE

Pod

Container

type=BE

Deployment

version=1 type=BE

Current: 2 Desired: 2

Deployment

version=3version=2version=2

version=2 type=BE

Current: 1 Desired: 1

Service

VIP

name=backend Label selector: type=BE

Consumers

Page 54: Container orchestration on_aws

@phennex

Governed by the Cloud Native Computing Foundation

Built by many years of experience with containers at Google

Topmost projects on Github

Large and engaged community

Why Kubernetes?

Page 55: Container orchestration on_aws

@phennex

Too small application for setting up a cluster?

Why NOT Kubernetes?

Page 56: Container orchestration on_aws

@phennex

HOW TO SET THIS UP ON AWS?

Page 57: Container orchestration on_aws

@phennex

Page 58: Container orchestration on_aws

@phennex

Page 59: Container orchestration on_aws

@phennex

Page 60: Container orchestration on_aws

@phennex

Page 61: Container orchestration on_aws

@phennex

Rancher Catalog

User Management

Container Orchestration and Scheduling

Infrastructure Services (Storage, Networking, Load Balancer, DNS, etc.)

Ops Management

Rancher overview

LDAP

Leverage existing tools: - CI/CD - Monitoring - etc.

Page 62: Container orchestration on_aws

@phennex

DEMO: KUBERNETES ON AWS WITH RANCHER

Page 63: Container orchestration on_aws

@phennex

OTHER SOLUTIONS

Page 64: Container orchestration on_aws

@phennex https://stackpoint.io/#/

Page 65: Container orchestration on_aws

@phennex

https://github.com/kubernetes/kops

Page 66: Container orchestration on_aws

@phennex

DEMO: KUBERNETES ON AWS WITH KOPS

Page 67: Container orchestration on_aws

@phennex

Page 68: Container orchestration on_aws

@phennex

Page 69: Container orchestration on_aws

@phennex

Page 70: Container orchestration on_aws

@phennex

Page 71: Container orchestration on_aws

@phennex

WHAT WOULD YOU CHOOSE?

Page 72: Container orchestration on_aws

@phennex

? Questions

Page 73: Container orchestration on_aws

Thank you! @phennex

[email protected]

@phennex

Page 74: Container orchestration on_aws

Resources

@phennex

https://apprenda.com/blog/introducing-kismatic-enterprise-toolkit-fully-automated-path-production-kubernetes/

https://www.openshift.com/

http://rancher.com/

http://research.google.com/pubs/pub44843.html

http://research.google.com/pubs/pub43438.html

https://docs.docker.com/swarm/overview/

http://kubernetes.io/

Page 75: Container orchestration on_aws

Graphic credits

@phennex

http://www.freepik.com

Many of the used illustrations in this presentation is designed by