A Primer on Kubernetes and Google Container Engine

61
A PRIMER ON KUBERNETES AND GOOGLE CONTAINER ENGINE

Transcript of A Primer on Kubernetes and Google Container Engine

A PRIMER ON KUBERNETES AND GOOGLE CONTAINER

ENGINE

Panelists

• Preston Holmes• Senior Cloud Solution Architect, Google

• Ryan O’Leary• Senior Product Manager

POLLS

3

Agenda

• Linux container concepts• The Role of Kubernetes• Primer on Google Container Engine• How RightScale works with containers and clusters

PRIMER ON KUBERNETES AND GOOGLE CONTAINER

ENGINE

5

Containers at Google

A Primer on Kubernetes and Google Container Engine

Preston HolmesSolution Architect@ptone

“Google is living a few years in the future and sending the rest of us messages”Doug Cutting - Hadoop Co-Creator

Late 1990’sEarly 2000’s

A datacenter is not a collection of computers,a datacenter is a computer.

VMs vs. Containers

Physical Processor

Virtual Processor

Operating System

Libraries

User Code PrivateCopy

Shared

Virtual Machines

Physical Processor

Virtual Processor

Operating System

Libraries

User Code

Containers

ISA

syscall

Containers: less overhead, enable more “magic”

Google has been developing and using containers to manage our applications for over 10 years.

Images by Connie Zhou

2004

2006

2013

2014

Limitedisolation

ReleasedCGroups

ReleasedLMCTFY

Kubernetes

Google and containersContainers

Google and container technology

Containers at Google

Developed as only practical way to manage Google-scale compute

Everything at Google runs in a container

Containers at Google

Developed as only practical way to manage Google-scale compute

Everything at Google runs in a container

We launch over2 Billioncontainers per week.

What is Docker?

• An implementation of the container idea• A package format• Resource isolation (via libcontainer)• An ecosystem• A company

Hoorah! The world is starting to adopt containers!

Containers need management

More than just packing and isolation

Scheduling: Where should my containers run?

Lifecycle and health: Keep my containers running despite

failures

Discovery: Where are my containers now?

Monitoring: What’s happening with my containers?

Auth{n,z}: Control who can do things to my containers

Aggregates: Compose sets of containers into jobs

Scaling: Making jobs bigger or smaller

•Kubernetes

•Kubernetes(brought to you by the team that brought you Borg)

•Kubernetes(brought to you by the team that brought you Borg)

(and hundreds more contributors)

Kubernetes is Owned By Everyone

Open-source container orchestration

Broad industry support

Supports multi-cloud, on-prem VM, bare metal

Kubernetes

Kubernetes is Owned By Everyone

Open-source container orchestration

Broad industry support

Supports multi-cloud, on-prem VM, bare metalKubernetes

An Amazing Community

● Fastest growing orchestrator○ around 200 pull requests per week ...○ from 400+ contributors

● Most all design discussion happens in open on IRC channel

•Kubernetes is a universal deployment target

Real World Adoption● Use Kubernetes to simplify shipping software:

● Use Kubernetes in high scale environments -

● Extend Kubernetes to new powerful scenarios - Samsung

Kubernetes Architecture

etcd API Server

Scheduler

Controller Manager

Kubelet

Service Proxy

kubectl, ajax, etc

users master nodes

A 50000 foot view

CLI

API

UI

apiserver

kubelet

kubelet

kubelet

scheduler

A 50000 foot view

apiserver

kubelet

kubelet

kubelet

scheduler

Run XReplicas = 2Memory = 4GiCPU = 2.5

A 50000 foot view

apiserver

kubelet

kubelet

kubelet

scheduler

Which nodes for X ?

A 50000 foot view

apiserver

kubelet

kubelet

kubelet

scheduler

Run X

Run X

A 50000 foot view

apiserver

kubelet

kubelet

kubelet

scheduler

Registry

pull X

pull X

A 50000 foot view

apiserver

kubelet

kubelet

kubelet

scheduler

Statu

s X

Status X

X

X

A 50000 foot view

apiserver

kubelet

kubelet

kubelet

scheduler

X

X

GET X

A 50000 foot view

apiserver

kubelet

kubelet

kubelet

scheduler

X

X

Status X

All you really care about

Run X Master

Container Cluster

X

X

Status X

Primary concepts

Container: A sealed application package (Docker)

Pod: A small group of tightly coupled Containers

Labels: Identifying metadata attached to objects

Selector: A query against labels, producing a set result

Controller: A reconciliation loop that drives current state towards desired state

Service: A set of pods that work together

Kubernetes Concepts: Pods

Container Foo

Namespaces- Net- IPC- ..

Container Bar

Kubernetes Concepts: Pods

Container Foo

Container Bar

Namespaces- Net- IPC- ..

Networking

Kubernetes Concepts: Pods

Container Foo

Container Bar

Namespaces- Net- IPC- ..

Volumes

Container Foo

Container Bar

Namespaces- Net- IPC- ..

Kubernetes Concepts: Pods

Labels

Nginx Git Syncher

Pod Example

Node.JS Git Syncher

Pod Example

WebApp Twemproxy

Pod Example

localhost

Search Index

Shard Loader

Pod Example

Shared Memory

Kubernetes Concepts: Labels

frontendproduction

production

backend

production

backend

QA

testing

Kubernetes Concepts: Labels

frontendproduction

production

backend

production

backend

QA

testing

stage: production

Kubernetes Concepts: Labels

frontendproduction

production

backend

production

backend

QA

testing

stage: productionrole: backend

Reconciliation

Reconciliation

pods:- foo- bar

pods:- foo

Create

Reconciliation

pods:- foo- bar

pods:- foocreate “bar”

Create

Reconciliation

pods:- foo- bar

pods:- foo

Health Check

Reconciliation

pods:- foo

pods:- foo- bar

Delete

Reconciliation

pods:- foo

pods:- foo- bar

Delete

delete “bar”

Kubernetes Concepts: Replication Controller

production

backend

production

backendproduction

backend

#N

Kubernetes Concepts: Services

production

backend

production

backendproduction

backend

port(s)

name 1.2.3.4

“name”

Google Container Engine- Inspired by a decade within Google

- Re-imagines Cluster computing- Designed for a multi-cloud world

Photo by Connie Zhou

Run and manage an optimized cluster

KubernetesOpen Source

Workload

API & Tools Google Container Engine (GKE)

Google Container Engine

Kubernetes ● Growing Community ● Linux containers support● Open source orchestration

• Container Engine

● Provisioned cluster in seconds

● Optimized cluster environment

● Runs and manages Kubernetes

create and manage GKE

Master GKE Nodes

Compute Engine

VMs

Questions?

http://kubernetes.io/

#google-containers

[email protected]

github.com/GoogleCloudPlatform/kubernetes

cloud.google.com/container-engine

RightScale and Containers

Self-Service Cloud Analytics

RightScale Cloud Portfolio Management

Cloud Management

Design

VirtualizedEnvironments

PublicClouds

OtherServices

PrivateClouds

Automate

Multi-Cloud Orchestration & Governance

OperateDeploy Report Optimize

58

ContainerCluster

BareMetal

Automating Cluster Deployments

59

Master

Nodes

Pod A Pod B

DNS

Configure a cluster:Cloud Application Template

(CAT)Deployment on any

cloud/virtualEnd-user configurable

Managed by IT

Configure components:• Master• Nodes• Pods• Containers• External services (DNS, etc)

Q&A

Google/Kuberneteshttp://kubernetes.io/#google-containers

[email protected]/GoogleCloudPlatform/kubernetes

cloud.google.com/container-engine

RightScaleWebinar on how RightScale does Docker in Production

http://www.rightscale.com/docker-webinar

THANK YOU.