29
©2016 Apigee Corp. All Rights Reserved. A Microservice Story at Google Dan Paik Product Manager, Google

Adapt or Die: A Microservices Story at Google

Embed Size (px)

Citation preview

©2016 Apigee Corp. All Rights Reserved.

A Microservice Story at Google

Dan PaikProduct Manager, Google

©2016 Apigee Corp. All Rights Reserved.

Containers 101

©2016 Apigee Corp. All Rights Reserved.

2

Application Containers are changing the way people deploy and run applications

Hypervisor

Guest environment

app code

libraries

guest kernel

This is vanilla virtualization

machine image locked into a

platform

It has downsides:Not portable & Opaque

Hypervisor

Guest environment

app code

libraries

guest kernel

It has downsides:No Isolation

Hypervisor

Guest environment

app code

libraries

guest kernel

dependency???app code

It has downsides:Little Reuse

Hypervisor

Guest environment

app code

libraries

guest kernel

Guest environment

app code

libraries

guest kernel

Guest environment

app code

libraries

guest kernelredundant

Containers create a better abstraction layer

Hypervisor

Guest environment

app code

libraries

guest kernel

cut here

Node environment

Much better: Portable, isolated, static app environments

Hypervisor

node kernel

app code

libraries

app code

libraries

app code

libraries

container 1 container 2 container 3

Google confidential │ Do not distribute

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

Images by Connie Zhou

2B launched per week● simplifies

management● performance isolation● efficiency

it hasn’t always been easy

we needed to do better

ClusteringDeclarative app model

Agile, decoupled app architectureSmart (ML enhanced) active management

ContainersHermetically sealed deployment units

Efficient isolation and resource use

our Bad Old World: machine images Everything (app and OS) bundled up in machine images

Fragile, tightly coupled apps and little resource fungibilityLow resource efficiency

a Better New World: cloud native computingRadically enhanced developer productivity: snap together systems

Radically reduced operations overhead: rely on smart systemsRadically simpler deployments: immutable infrastructure

cloud native computing: Google style

• container packaged• predictable deployment; efficient resource isolation

• dynamically scheduled• radically higher QoS and efficiency; radically lower ops cost

• micro-services oriented• radically higher reuse; easier to extend

Separation of concerns = operations specialization

Separate infrastructure ops from cluster ops from app opsDeliver common cluster servicesRadically reduced operations overhead

what Google got from this

what Google got from this

Deeper automation = fewer bad outcomes

Higher abstraction provides more insight into behaviorOrchestration made far easierSelf-healing and self-managing systems

what Google got from this

Radically better physical efficiency

Containers offer efficient and fine grained resource isolationResource aware schedulingSafer, less intrusive overcommitment

but it’s all so different

• Deployment• Management, monitoring• Isolation (very complicated!)• Updates• Discovery• Scaling, replication, setsA fundamentally different way of managing applications requires different tooling and abstractions

Images by Connie Zhou

kubernetes

Greek for “Helmsman”; also the root of the words “governor” and “cybernetic”

• Manages container clusters• Inspired and informed by Google’s

experiences and internal systems• Supports multiple cloud and bare-metal

environments• Supports multiple container runtimes• 100% Open source, written in Go

Manage applications, not machines

Google Cloud Platform

Kubernetes at a glance Open source production-grade container scheduling and management

● Top 0.01% of all GitHub projects: 1000+ contributors & 35,000+ commits

Run Anywhere: multi-cloud, on-prem, bare-metal, OpenStack, etc.

Broad industry adoption

Commercial Enterprise Support

Kubernetes at a glance

One or more containers co-scheduled, scaled and versioned [Pods]

Automated health checking and rolling upgrades [Replication Controller]

Decoupling of components and late binding [Labels]

Late Binding a service endpoint that can span multiple Pod versions [Services]

Kubernetes Design Principles

registry

containersService

Pods

Each pod contains one or more containers

Nodes

Role: frontend

Role: frontend

Role: frontend

Role: frontend

Replication controllerReplicas: 3

Env: prod

microservice

labels

Service communication channel

Blueprint“pod template”

Env: prod Env: prod Env: prod

Kubernetes provides the basic building blocks for Microservice patterns by providing a toolbox of primitives for developers to compose a distributed system with pieces that operate independently

Kubernetes provides microservice-centric infrastructure

Once specific containers are no longer bound to specific machines/VMs,host-centric infrastructure no longer works• Scheduling: Decide where my containers should run• Lifecycle and health: Keep my containers running despite failures• Scaling: Make sets of containers bigger or smaller• Naming and discovery: Find where my containers are now• Load balancing: Distribute traffic across a set of containers• Storage volumes: Provide data to containers• Logging and monitoring: Track what’s happening with my containers• Debugging and introspection: Enter or attach to containers• Identity and authorization: Control who can do things to my containers

Google Cloud Platform

Kubernetes offers choice and flexibility for Hybrid Cloud

Setting up and managing a cluster • Choose a cloud: GCE, AWS, Azure, Rackspace, on-premises, ...• Choose a node OS: CoreOS, Atomic, RHEL, Debian, CentOS, Ubuntu, ...• Provision machines: create VMs, install Docker, ...• Configure networking: IP ranges for Pods, Services, SDN, firewalls, ...• Start cluster services: DNS, logging, monitoring, …• Start and configure Kubernetes• Manage nodes: kernel upgrades, OS updates, hardware failures, …

GKE is Google hosted and managed Kubernetes• Directly uses upstream open source• Rolls out within 3-5 business days of the latest open source release• Alpha features also now available through ‘alpha clusters’

Google Cloud Platform

Google Container Engine (GKE)“It delivers a high-performing, flexible infrastructure that lets us independently scale components for maximum efficiency”

~ Philips (Hue Lights)

“Made our engineers more productive and helped us do more work with less staff” ~ CCP Games (EVE Online)

©2016 Apigee Corp. All Rights Reserved.

Apigee Extension of K8s

©2016 Apigee Corp. All Rights Reserved.

24

©2016 Apigee Corp. All Rights Reserved.

Problem

25

Text

Customers want to code APIs, not just configure

©2016 Apigee Corp. All Rights Reserved.

Why Apigee Chose K8s

26

Text

•Focused and Extensible•Container-native•Language neutral•Cloud neutral

©2016 Apigee Corp. All Rights Reserved.

Multi-tenancy Extension: Namespace & Control Plane Isolation

27

Text

©2016 Apigee Corp. All Rights Reserved.

Vision: Container Native API Management

28

Text

©2016 Apigee Corp. All Rights Reserved.

Key Takeaways

29

Text

Apigee & Kubernetes:● runs anywhere and abstracts away the underlying

infrastructure● patterns provide the building blocks for deploying and

managing microservices● speeds application development by promoting re-use● enables separation of concerns and allow developers to focus

on functionality