what’s new in k8s 1 - files.meetup.com · what’s new in k8s 1.3 carter morgan @_askcarter...

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

Upload: others

Post on 09-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

What’s New in K8s 1.3

Carter Morgan@_askcarter

@_askcarter

Page 2: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Background: 3 Hurdles

@_askcarter

Page 3: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

The InfraCan I scale?

Is it automatic?

Am I locked in?

@_askcarter

Page 5: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

The Wild Where are my machines?

How do I update?

@_askcarter

Page 6: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Kubernetes

Open Source Container Automation Framework

• Open API

• Based on Google’s experiences

@_askcarter

Page 7: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

3 Claims

@_askcarter

Page 8: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

How does k8s hold up?

@_askcarter

Page 9: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

monolith

nginx

hello

nginx

Microservices

Monolith

auth

@_askcarter

Page 11: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Container BasedPhoto © ptnimages via Canva.com

@_askcarter

Page 12: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

DeploymentsDrive current state towards desired state

Node 1

Pod

app: hello replicas: 1

hello

Node 2

@_askcarter

Page 18: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

DeploymentsDrive current state towards desired state

Node 1

Pod

app: hello replicas: 2

hello

Node 2

@_askcarter

Page 20: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

Node

Podhello

Node

Podhello

Service

@_askcarter

Page 22: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

Node

Podhello

Node

Podhello

Service

Podgoodbye

@_askcarter

Page 23: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

Node

Podhello

Node

Podhello

Service

Podgoodbye

@_askcarter

Page 24: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

Node

Podhello

Node

Podhello

Service

Podgoodbye

@_askcarter

Page 25: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Podhello

Service

Podgoodbye

Podgoodbye

@_askcarter

Page 26: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Podhello

Service

Podgoodbye

Podgoodbye

@_askcarter

Page 27: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Podhello

Service

Podgoodbye

Podgoodbye

@_askcarter

Page 28: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Service

Podgoodbye

Podgoodbye

@_askcarter

Page 29: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Service

Podgoodbye

Podgoodbye

Podgoodbye

@_askcarter

Page 30: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Service

Podgoodbye

Podgoodbye

Podgoodbye

@_askcarter

Page 31: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node

Podhello

NodeNode

Service

Podgoodbye

Podgoodbye

Podgoodbye

@_askcarter

Page 32: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Rolling Update

Node 1

Podhello

Podhello

Node NodeNode

Service

Podgoodbye

Podgoodbye

Podgoodbye

@_askcarter

Page 33: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

3 Claims: revisited

@_askcarter

Page 34: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Kubernetes 1.3

@_askcarter

Page 35: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Kubernetes 1.3

@_askcarter

Page 36: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 37: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Cluster Federation

Manage clusters across region and providers

@_askcarter

Page 38: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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 39: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Job: Work Queue with Pod Per Work Item

@_askcarter

Page 40: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Init ContainersSequential Pod Initialization

@_askcarter

Pod

Init 1

monolith

NFS

10.1.0.100

Init 2 Init 3

Page 41: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Init Container: register pod to external service

@_askcarter

Page 42: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Init Container: clone a git repo into a volume

@_askcarter

Page 43: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Pet SetsPods with ego

Pods are fungible, stateless?

Pets are Pods with:

1. Stable hostname2. A unique name3. Stable storage

@_askcarter

Page 44: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Pet SetsPods with ego

@_askcarter

Page 45: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

PetSet: example manifest

@_askcarter

Page 46: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

PetSet: headless service

@_askcarter

Page 47: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Bonus

@_askcarter

Page 48: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Google Container

Engine(GKE)

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

@_askcarter

Page 49: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

minikube github.com/kubernetes/minikube

@_askcarter

Page 50: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

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

@_askcarter

Page 51: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Thing I learned (making this talk)

(making this talk)

@_askcarter

Page 52: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Recap

@_askcarter

Page 53: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

3 HurdlesThe App

The Infra

The Wild

@_askcarter

Page 54: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

3 ClaimsPlanet Scale

Never Outgrow

Run Anywhere

@_askcarter

Page 55: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Kubernetes 1.3Planet Scale - SLA 2000 nodes

Never Outgrow - minikube to prod

Run Anywhere - Cluster Federation

@_askcarter

Page 56: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Scalable Microservice

with Kubernetes

@_askcarter

Page 57: What’s New in K8s 1 - files.meetup.com · What’s New in K8s 1.3 Carter Morgan @_askcarter @_askcarter. Background: 3 Hurdles @_askcarter. The App ... How does k8s hold up? @_askcarter

Carter Morgan@_askcarter

Learn more here!http://blog.kubernetes.io/2016/07/kubernetes-1.3-bridging-cloud-native-and-enterprise-workloads.html

@_askcarter