What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks...

54
What’s New in K8s 1. 3 Carter Morgan @_askcarter @_askcarter

Transcript of What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks...

Page 1: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

What’s New in K8s 1.3

Carter Morgan@_askcarter

@_askcarter

Page 2: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Background: 3 Hurdles

@_askcarter

Page 3: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

The AppHow do I write scalable apps?

How do I package and distribute?

What runtimes am I locked into?

@_askcarter

Page 4: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

The InfraCan I scale?

Is it automatic?

Am I locked in?

@_askcarter

Page 5: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

The Wild Where are my machines?

How do I update?

@_askcarter

Page 6: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Kubernetes

Open Source Container Automation Framework

• Open API

• Based on Google’s experiences

@_askcarter

Page 7: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

3 Claims

@_askcarter

Page 8: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

How does k8s hold up?

@_askcarter

Page 9: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Kubernetes Pre 1.3

Horizontal ScalingAutomated RollbacksContainer SchedulingResource Quotas and LimitsSelf-healingService Discovery and Load BalancingSecret and Configuration ManagementDaemon SetsSecrets and Config MapsDeployments

(already had a lot)

@_askcarter

Page 10: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

monolith

nginx

hello

nginx

Microservices

Monolith

auth

@_askcarter

Page 11: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Container BasedPhoto © ptnimages via Canva.com

@_askcarter

Page 12: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

PodsLogical Application• One or more containers

and volumes• Shared namespaces• One IP per pod Pod

nginx

monolith

NFSiSCSIGCE

10.1.0.100

@_askcarter

Page 13: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

LabelsArbitrary metadata attached to any API object• Queryable by Selectors• How Kubernetes does

groupingPod

nginx

monolith

Pod

nginx

monolith

labels: version: v1 track: stable

labels: version: v1 track: test

@_askcarter

Page 14: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Labels

selector: version=v1Pod

nginx

monolith

Pod

nginx

monolith

labels: version: v1 track: stable

labels: version: v1 track: test

@_askcarter

Page 15: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Labels

selector: track=stablePod

nginx

monolith

Pod

nginx

monolith

labels: version: v1 track: stable

labels: version: v1 track: test

@_askcarter

Page 16: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

ServicesPersistent IPs for Pods• Uses Labels to

Target Pods• Internal or External IPs

Pod

nginx

monolith

Pod

nginx

monolith

Service10.8.244.100

10.1.0.210.1.0.1

@_askcarter

Page 17: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

DeploymentsDrive current state towards desired state

Node 1

Pod

app: hello replicas: 1

hello

Node 2

@_askcarter

Page 18: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

DeploymentsDrive current state towards desired state

Node 1

Pod

app: hello replicas: 2

hello

Node 2

Podhello

@_askcarter

Page 19: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

DeploymentsDrive current state towards desired state

Node 1

Pod

app: hello replicas: 2

hello

Node 2

@_askcarter

Page 20: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

DeploymentsDrive current state towards desired state

Node 1

Pod

app: hello replicas: 2

hello

Node 2

Podhello

@_askcarter

Page 21: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

Node

Podhello

Node

Podhello

Service

@_askcarter

Page 22: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

Node

Podhello

Node

Podhello

Service

Podgoodbye

@_askcarter

Page 23: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

Node

Podhello

Node

Podhello

Service

Podgoodbye

@_askcarter

Page 24: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

Node

Podhello

Node

Podhello

Service

Podgoodbye

@_askcarter

Page 25: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Podhello

Service

Podgoodbye

Podgoodbye

@_askcarter

Page 26: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Podhello

Service

Podgoodbye

Podgoodbye

@_askcarter

Page 27: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Podhello

Service

Podgoodbye

Podgoodbye

@_askcarter

Page 28: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Service

Podgoodbye

Podgoodbye

@_askcarter

Page 29: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Service

Podgoodbye

Podgoodbye

Podgoodbye

@_askcarter

Page 30: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Service

Podgoodbye

Podgoodbye

Podgoodbye

@_askcarter

Page 31: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Service

Podgoodbye

Podgoodbye

Podgoodbye

@_askcarter

Page 32: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Rolling Update

Node 1

Podhello

Podhello

Node NodeNode

Service

Podgoodbye

Podgoodbye

Podgoodbye

@_askcarter

Page 33: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

3 Claims: revisited

@_askcarter

Page 34: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Kubernetes 1.3

Init containers (alpha)Fixed PDsCluster Federation (alpha)Optional HTTP2Pod Level QoS PolicyTls secretskubectl set commandUIJobsRBAC (alpha, experimental)Garbage Collector (alpha)Pet Setsrkt Container runtimeNetwork policies(and more)

@_askcarter

Page 35: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Cluster Federation

Manage clusters across region and providers

@_askcarter

Page 36: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

JobsPods *expected* to terminate

Creates 1...n Pods and ensures that a certain number of them run to completion

3 types: non-parallel, fixed count parallel, and parallel with a work queue

@_askcarter

Page 37: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Job: Work Queue with Pod Per Work Item

@_askcarter

Page 38: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Init ContainersSequential Pod Initialization

@_askcarter

Pod

Init 1

monolith

NFS

10.1.0.100

Init 2 Init 3

Page 39: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Init Container: register pod to external service

@_askcarter

Page 40: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Init Container: clone a git repo into a volume

@_askcarter

Page 41: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Pet SetsPods with ego

Pods are fungible, stateless?

Pets are Pods with:

1. Stable hostname2. A unique name3. Stable storage

@_askcarter

Page 42: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

PetSet: example manifest

@_askcarter

Page 43: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

PetSet: headless service

@_askcarter

Page 44: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Bonus

@_askcarter

Page 45: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Google Container

Engine(GKE)

Cluster autoscaling (beta)IAM supportLocal SSDContainer-VM Images (beta)Node pools

@_askcarter

Page 46: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

minikube github.com/kubernetes/minikube

@_askcarter

Page 47: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Kube UIkubernetes.io/docs/user-guide/ui/

(demo)

@_askcarter

Page 48: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Thing I learned(making this talk)

kubectl explain deployment.spec.minReadySeconds

@_askcarter

Page 49: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Recap

@_askcarter

Page 50: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

3 HurdlesThe App

The Infra

The Wild

@_askcarter

Page 51: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

3 ClaimsPlanet Scale

Never Outgrow

Run Anywhere

@_askcarter

Page 52: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Kubernetes 1.3Planet Scale -

Never Outgrow - minikube to prod

Run Anywhere - Cluster Federation

@_askcarter

Page 53: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Scalable Microservice

with Kubernetes

@_askcarter

Page 54: What’s New in K8s 1files.meetup.com/18569714/What's New in K8s 1.3.pdf · Automated Rollbacks Container Scheduling Resource Quotas and Limits Self-healing Service Discovery and

Carter Morgan@_askcarter

Watch blog.kubernetes.io for the big release!

@_askcarter