kubernetes: where we are, where we’re going and why

55
Kubernetes Where we are, where we’re going and why Brendan Burns Senior Staff Software Engineer

Upload: kubeacademy

Post on 15-Apr-2017

856 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Kubernetes: Where we are, where we’re going and why

KubernetesWhere we are, where we’re going and why

Brendan BurnsSenior Staff Software Engineer

Page 2: Kubernetes: Where we are, where we’re going and why

Where are we?

Page 3: Kubernetes: Where we are, where we’re going and why

Where are you?

Page 4: Kubernetes: Where we are, where we’re going and why

Where are we going?

Page 5: Kubernetes: Where we are, where we’re going and why

Where are we going?

We’re making reliable, scalable, agile distributed systems a CS101 exercise

Page 6: Kubernetes: Where we are, where we’re going and why

Scaling Kubernetes to 1M QPS

Page 7: Kubernetes: Where we are, where we’re going and why

Building a demo to 1M QPS

nginx-service10.0.0.3

Loadbot Replication Controller

Page 8: Kubernetes: Where we are, where we’re going and why

Building a demo to 1M QPS

nginx-service10.0.0.3

Kubernetes API Server

Data Aggregator

pods whereapp=loadboat

data-service10.0.0.4

Demo GUI

Page 9: Kubernetes: Where we are, where we’re going and why

The road ahead

1

2

3

Kubernetes 1.1

Looking ahead to Kubernetes 1.2

Flags in the distance

Page 10: Kubernetes: Where we are, where we’re going and why

Kubernetes 1.1

Autoscaling BatchJobs

HTTP Load Balancing

Resource Overcommit

IP Tables Kube Proxy

Newkubectl tools

1M QPS, 1000+ nodes* and much more!

Page 11: Kubernetes: Where we are, where we’re going and why

Kubernetes 1.1

Autoscaling 1M QPS1k+ Nodes

HTTP Load Balancing

Resource Overcommit

IP Tables Kube Proxy

Newkubectl tools

And much more!

Releasing today!

Rolling out to Google Container Engine this week[new clusters]

Rolling out to existing Container Engine clusters in ~2 weeks[send us a note if you want it earlier]

Page 12: Kubernetes: Where we are, where we’re going and why

Ingress for HTTP Load Balancing [Beta]

Service-foo: 24.1.2.3 Service-bar: 24.4.5.6

Page 13: Kubernetes: Where we are, where we’re going and why

Ingress for HTTP Load Balancing

Service-foo: 10.0.0.1 Service-bar 10.0.0.2

api.company.com24.7.8.9

http://api.company.com/foo http://api.company.com/bar

Page 14: Kubernetes: Where we are, where we’re going and why

Ingress for HTTP Load Balancing

Service-foo: 10.0.0.1 Service-bar 10.0.0.2

api.company.com24.7.8.9

http://api.company.com/foo http://api.company.com/bar

Ingress API

Page 15: Kubernetes: Where we are, where we’re going and why

Ingress API

apiVersion: extensions/v1beta1kind: Ingressmetadata: name: testspec: rules: - host: k8s.io http: paths: - path: /foo backend: serviceName: fooSvc servicePort: 80 - path: /bar backend: serviceName: barSvc servicePort: 80

fooSvc barSvc

http://k8s.io/foo http://k8s.io/bar

Page 16: Kubernetes: Where we are, where we’re going and why

Ingress API

apiVersion: extensions/v1beta1kind: Ingressmetadata: name: testspec: rules: - host: k8s.io http: paths: - backend: serviceName: k8sSvc servicePort: 80 - host: j7a.io http: paths: - backend: serviceName: j7aSvc servicePort: 80

k8sSvc j7aSvc

http://k8s.io/* http://j7a.io/*

Page 17: Kubernetes: Where we are, where we’re going and why

Implementing Ingress

Ingress Object Ingress Controller● GCE● HAProxy*● ...

Page 18: Kubernetes: Where we are, where we’re going and why

Horizontal Pod Autoscaling [Beta]

Service-foo: 10.0.0.1

api.company.com24.7.8.9

http://api.company.com/foo

Page 19: Kubernetes: Where we are, where we’re going and why

Horizontal Pod Autoscaling [Beta]

Service-foo: 10.0.0.1

api.company.com24.7.8.9

http://api.company.com/foo

https://www.flickr.com/photos/davedehetre/4440211085

Page 20: Kubernetes: Where we are, where we’re going and why

Horizontal Pod Autoscaling [Beta]

apiVersion: extensions/v1beta1

kind: HorizontalPodAutoscaler

metadata:

name: php-apache

spec:

scaleRef:

kind: ReplicationController

name: php-apache

namespace: default

minReplicas: 1

maxReplicas: 10

cpuUtilization:

targetPercentage: 50

https://www.flickr.com/photos/davedehetre/4440211085

Page 21: Kubernetes: Where we are, where we’re going and why

But why is it called “Horizontal”?

Page 22: Kubernetes: Where we are, where we’re going and why

But why is it called “Horizontal”?

Page 23: Kubernetes: Where we are, where we’re going and why

But why is it called “Horizontal”?

Page 24: Kubernetes: Where we are, where we’re going and why

Jobs [Beta]

Service-foo: 10.0.0.1

api.company.com24.7.8.9

http://api.company.com/foo

Page 25: Kubernetes: Where we are, where we’re going and why

Jobs

Service-foo: 10.0.0.1

api.company.com24.7.8.9

http://api.company.com/foo Start Finish

Page 26: Kubernetes: Where we are, where we’re going and why

Jobs

Start Finish

apiVersion: extensions/v1beta1kind: Jobmetadata: name: ffmpegspec: selector: matchLabels: app: ffmpeg template: metadata: labels: app: ffmpeg spec: containers: - name: ffmpeg image: ffmpeg restartPolicy: OnFailure

Page 27: Kubernetes: Where we are, where we’re going and why

Jobs

Start Finish

apiVersion: extensions/v1beta1kind: Jobmetadata: name: ffmpegspec: selector: matchLabels: app: ffmpeg # run 5 times before done completions: 5

...

Page 28: Kubernetes: Where we are, where we’re going and why

Jobs

Start Finish

apiVersion: extensions/v1beta1kind: Jobmetadata: name: ffmpegspec: selector: matchLabels: app: ffmpeg # run 5 times before done completions: 5 parallelism: 2...

Page 29: Kubernetes: Where we are, where we’re going and why

Jobs are a foundation

https://www.flickr.com/photos/dgoomany/4976873174 https://www.flickr.com/photos/kubina/278696130

Shard numbers, Scheduled Jobs, Workflow and more...

Page 30: Kubernetes: Where we are, where we’re going and why

New APIs: HTTP Load Balancing with Ingress

fooSvc barSvc

http://k8s.io/foo http://k8s.io/bar

Page 31: Kubernetes: Where we are, where we’re going and why

New APIs: Horizontal Pod AutoScaling

Page 32: Kubernetes: Where we are, where we’re going and why

New APIs: Jobs

Start Finish

Page 33: Kubernetes: Where we are, where we’re going and why

But that’s not all...

Autoscaling BatchJobs

HTTP Load Balancing

Resource Overcommit

IP Tables Kube Proxy

Newkubectl tools

1M QPS, 1000+ nodes* and much more!

Page 34: Kubernetes: Where we are, where we’re going and why

Memory Overcommit

Guaranteed

Burstable

Best Effort

Page 35: Kubernetes: Where we are, where we’re going and why

Memory Overcommit

Resource Class Request Limit

Best Guaranteed 10G 10G

Better Burstable 5G 10G

Good Best Effort - 10G

Page 36: Kubernetes: Where we are, where we’re going and why

IPTables Proxy

Page 37: Kubernetes: Where we are, where we’re going and why

kubectl improvements

kubectl run -i --tty shell --image=busybox -- sh

kubectl attach -i --tty my-pod

kubectl edit pods my-pod

kubectl apply ...

Page 38: Kubernetes: Where we are, where we’re going and why

Rolling update improvements

Page 39: Kubernetes: Where we are, where we’re going and why

Rolling update improvements

Page 40: Kubernetes: Where we are, where we’re going and why

Rolling update improvements

Page 41: Kubernetes: Where we are, where we’re going and why

The road ahead

1

2

3

An overview of Kubernetes 1.1

Looking ahead to Kubernetes 1.2

Flags in the distance

Page 42: Kubernetes: Where we are, where we’re going and why

Why are we all here?

It’s not to run N nodes or M containersFrankly, it’s not even to run containersIt’s to build applicationsIt’s to operate applicationsIt’s to update applications

And to do it all easily.

Page 43: Kubernetes: Where we are, where we’re going and why

Envisioning distributed systems as applications

type LeaderFn func(isLeader bool, leaderName string)

type LeaderElector interface {InstallLeaderFunc(leaderFn LeaderFn)Run()

}

Page 44: Kubernetes: Where we are, where we’re going and why

Envisioning distributed systems as applications

func myLeaderFn(leader bool, leaderName string) {if leader {

fmt.Println("I'm the leader")} else {

fmt.Printf("%s is the leader\n", leaderName)}

}

Page 45: Kubernetes: Where we are, where we’re going and why

Envisioning distributed systems as applications

package main

func leaderFn(leader bool, leaderName string) { … }

func main() {elector := impl.NewLeaderElector()elector.InstallLeaderFunc(leaderFn)elector.Run()

}

Page 46: Kubernetes: Where we are, where we’re going and why

Envisioning distributed systems as applications

myLeaderElector

./myLeaderElector --replicas=3 --daemon

Page 47: Kubernetes: Where we are, where we’re going and why

Envisioning distributed systems as applications

myLeaderElector

./myLeaderElector --replicas=3 --daemon

Page 48: Kubernetes: Where we are, where we’re going and why

Envisioning distributed systems as applications

myLeaderElector

./myLeaderElector --replicas=3 --daemon

myLeaderElector

etcd

myLeaderElector

etcd

myLeaderElector

etcd

Page 49: Kubernetes: Where we are, where we’re going and why

Envisioning distributed systems as applications

myLeaderElector

./myLeaderElector --stop

myLeaderElector

etcd

myLeaderElector

etcd

myLeaderElector

etcd

Page 50: Kubernetes: Where we are, where we’re going and why

Envisioning distributed systems as applications

myLeaderElector

./myLeaderElector --stop

Page 51: Kubernetes: Where we are, where we’re going and why

The road ahead

1

2

3

An overview of Kubernetes 1.1

Looking ahead to Kubernetes 1.2

Flags in the distance

Page 52: Kubernetes: Where we are, where we’re going and why

Looking forward to Kubernetes 1.2 : Pre-built applications

Google Deployment Manager is Open Sourced!https://github.com/kubernetes/deployment-manager

Deis announces Helmhttps://github.com/deis/helm

And more to come...

backend10.0.0.3

frontend24.1.2.3

Page 53: Kubernetes: Where we are, where we’re going and why

Cluster-1

Looking forward to Kubernetes 1.2 : Cross cluster management

New Open Source UXhttps://github.com/kubernetes/dashboard

Cross cluster service import/export

TBD...

Cluster-2

Ubernetes

Page 54: Kubernetes: Where we are, where we’re going and why

Looking forward to Kubernetes 1.2 : Simplified Config

!! generator.kubernetes.io/java/v1

name: my-java-app

java: 7

jar: some/path/to/my.jar

replicas: 2

resources:

cpu: 1.0

memory: 10G

Page 55: Kubernetes: Where we are, where we’re going and why

Thank you!