SlideShare a Scribd company logo
Resilient Microservices with Kubernetes
Mete Atamel
Developer Advocate for Google Cloud
@meteatamel
Confidential & ProprietaryGoogle Cloud Platform 2
Mete Atamel
Developer Advocate for Google Cloud
@meteatamel
atamel@google.com
meteatamel.wordpress.com
Please send talk feedback: bit.ly/atamel
Google Cloud Platform
The .NET Revolution
@meteatamel
Google Cloud Platform
The world of 2014
ASP.NET
C#
Visual Studio
SQL Server
PowerShell
Java
Apache
MySQL
Eclipse
Bash
@meteatamel
Google Cloud Platform
Things are changing @meteatamel
ASP.NET Core
on Linux, Mac,
Windows
Microsoft joins
Linux foundation
Google joins
.NET foundation
2014
.NET Goes
Open Source
OpenSSH on
Windows
Ubuntu, Debian
on Azure
2015
SQL Server on
Linux
Bash on
Windows
PowerShell on
Linux
2016
Google Cloud Platform
The convergence
ASP.NET
C#
Visual Studio
SQL Server
Java
ApacheMySQL
PowerShell
Eclipse
Bash
Confidential & ProprietaryGoogle Cloud Platform 7
Great time to be a .NET developer!
Confidential & ProprietaryGoogle Cloud Platform 8
However, software development is HARD!
@meteatamel
And it is not getting any easier...
Google Cloud Platform
In the good old days @meteatamel
This is all I had to care...
Image Source: Wikipedia
Life was good :-)
Google Cloud Platform
A lot happened since then
Internet
App Servers
Web Servers
Databases
Microservices
The Monolith
Object Oriented
Programming
Version Control Caching
Cloud Computing
Firewalls
Virtual
Machines
Big Data
Machine
Learning
Mobile
DevOps IoT
Google Cloud Platform
Nowadays
ZONE A
Load Balancer
Health Endpoint Health Endpoint Health Endpoint
Health Checker
ZONE B
Load Balancer
Health Endpoint Health Endpoint Health Endpoint
Health Checker
REPLICATION
Task Queues
Autoscaler
Google Cloud Platform
Maintaining code in different languages on different types of machines
Rolling out the new version of your code reliably
Rolling back to the old version if something goes wrong
Managing configuration and secrets
Managing scripts that need to run on each machine
We haven’t even talked about
Google Cloud Platform
I just want to write some code to solve a real-world problem
@meteatamel
Google Cloud Platform
The reality
ZONE A
Load Balancer
Health Endpoint Health Endpoint Health Endpoint
Health Checker
ZONE B
Load Balancer
Health Endpoint Health Endpoint Health Endpoint
Health Checker
REPLICATION
Task Queues
Autoscaler
This is all I want to care This is all I have to care
What do we do?
Google Cloud Platform
In the good old days @meteatamel
Write your code, pass it to QA for testing, let operations team run it...
Google Cloud Platform
Nowadays, it is your problem
What do we do?
Google Cloud Platform
You can write your code in any language and run
anywhere exactly the same way
@meteatamel
Your app is optimally deployed somewhere and
managed by someone. It just works!
There are no machines. All resources are
automatically provisioned on demand
Google Cloud Platform
Write your code in any language and run it anywhere exactly the same way
⇒ Containers (eg. Docker, Rkt)
Your app is optimally deployed and managed
⇒ Container Management Platforms (eg. Kubernetes, Docker Swarm, Mesos)
All the resources needed for your app is automatically provisioned per demand
⇒ Cloud Providers (eg. Google Cloud, AWS, Azure)
Docker + Kubernetes + Cloud
Google Cloud Platform
Demo: Simple Microservice
@meteatamel
Google Cloud Platform
Containers
@meteatamel
Google Cloud Platform
✕ No isolation
✕ Common libs
✕ Highly coupled Apps
& OS
Why containers?
app
libs
kernel
libs
app app
kernel
app
libs
libs
kernel
kernel
libs
app
kernel
libs
app
libs
app
libs
app
✓ Isolation
✓ No Common Libs
✕ Expensive and
Inefficient
✕ Hard to manage
✓ Isolation
✓ No Common Libs
✓ Less overhead
✕ Less Dependency on
Host OS
kernel
libs
app
app app
app
Physical Machine Virtual Machines Containers
@meteatamel
Google Cloud Platform
What is a container?
Lightweight
Hermetically sealed
Isolated
Easily deployable
Introspectable
Composable
Linux (or Windows) processes
A lightweight way to virtualize applications
@meteatamel
Docker
Google Cloud Platform
Google has been developing
and using containers to
manage our applications for
over 12 years.
Images by Connie
Zhou
@meteatamel
Google Cloud Platform
Everything at Google runs in
containers
Gmail, Web Search, Maps, ...
MapReduce, batch, ...
GFS, Colossus, ...
Even Google’s Cloud Platform: our VMs
run in containers!
We launch over 2 billion
containers per week
@meteatamel
Google Cloud Platform
Demo: Containerised Microservice
@meteatamel
Google Cloud Platform
Containers not enough @meteatamel
Containers help to create a lightweight and consistent environment for apps
● Who takes care of redundancy?
● Who takes care of resiliency?
● Who scales up/down your app?
● Who and how a new version of your app gets deployed?
● Who rolls back to a previous version if something goes wrong?
● Etc. etc. etc.
But you still need to answer these questions:
Google Cloud Platform
Kubernetes
@meteatamel
Google Cloud Platform
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 (borg)
• Supports multiple cloud and bare-metal
environments
• Supports multiple container runtimes
• 100% Open source, written in Go
Manage applications, not machines
Kubernetes @meteatamel
Google Cloud Platform
kubelet
UI
kubeletCLI
API
users master nodes
etcd
kubelet
scheduler
controllers
apiserver
The 10000 foot view @meteatamel
Google Cloud Platform
UI
API
Container
Cluster
All you really care about @meteatamel
Google Cloud Platform
1. Setting up the cluster
• Choose a cloud: GCE, AWS, Azure, Rackspace, on-premises, ...
• Choose a node OS: CoreOS, Atomic, RHEL, Debian, CentOS, Ubuntu, ...
• Provision machines: Boot VMs, install and run kube components, ...
• Configure networking: IP ranges for Pods, Services, SDN, ...
• Start cluster services: DNS, logging, monitoring, ...
• Manage nodes: kernel upgrades, OS updates, hardware failures...
Not the easy or fun part, but unavoidable
This is where things like Google Container Engine (GKE) really help
Container clusters: A story in two parts @meteatamel
Google Cloud Platform
Kubernetes cluster on GKE @meteatamel
Google Cloud Platform
Windows Server Node in Kubernetes
Google Cloud Platform
Demo: Create Kubernetes cluster
@meteatamel
Google Cloud Platform
2. Using the cluster
• Run Pods & Containers
• Replica Sets
• Services
• Volumes
This is the fun part!
A distinct set of problems from cluster setup and management
Don’t make developers deal with cluster administration!
Accelerate development by focusing on the applications, not the cluster
Container clusters: A story in two parts @meteatamel
Google Cloud Platform
Kubernetes Building Blocks
@meteatamel
Google Cloud Platform
Deployment
Pod
Volume
Label
Selector
Kubernetes Terminology
ReplicaSet
Liveness Probe
Readiness Probe
Service
DaemonSet
Job
StatefulSet
ConfigMap
Secret
Container cluster
Service
Pods
Each pod containers
one or more containers
Nodes
Role: frontend
Role: frontend Role: frontend Role: frontend
Replication
controller
Replicas: 3
Env: prod
microservice
labels
Service
communication
channel
Blueprint
“pod
template”
Env: prod Env: prod Env: prod registry
containers
@meteatamel
Google Cloud Platform
Deployments
@meteatamel
Google Cloud Platform
A Deployment provides declarative updates for
Pods and Replica Sets
Describe the desired state and the Deployment
controller will change the actual state to the
desired state at a controlled rate for you.
Deployment manages replica changes for you
• stable object name
• updates are configurable, done server-side
• kubectl edit or kubectl apply
...
Deployments @meteatamel
Google Cloud Platform
Demo: Create Deployment
@meteatamel
Google Cloud Platform
Deployment
Pod
Volume
Label
Selector
Kubernetes Terminology
ReplicaSet
Liveness Probe
Readiness Probe
Service
DaemonSet
Job
StatefulSet
ConfigMap
Secret
Google Cloud Platform
Pods and Volumes
@meteatamel
Google Cloud Platform
Small group of containers & volumes
Tightly coupled
The atom of scheduling & placement
Shared namespace
• share IP address & localhost
• share IPC, etc.
Managed lifecycle
• bound to a node, restart in place
• can die, cannot be reborn with same ID
Example: data puller & web server
Consumers
Content
Manager
File
Puller
Web
Server
Volume
Pod
Pods @meteatamel
Google Cloud Platform
Pod-scoped storage
Support many types of volume plugins
• Empty dir (and tmpfs)
• Host path
• Git repository
• GCE Persistent Disk
• AWS Elastic Block Store
• Azure File Storage
• iSCSI
• Flocker
• NFS
• vSphere
• GlusterFS
• Ceph File and RBD
• Cinder
• FibreChannel
• Secret, ConfigMap,
DownwardAPI
• Flex (exec a binary)
• ...
Volumes @meteatamel
Google Cloud Platform
Deployment
Pod
Volume
Label
Selector
Kubernetes Terminology
ReplicaSet
Liveness Probe
Readiness Probe
Service
DaemonSet
Job
StatefulSet
ConfigMap
Secret
Google Cloud Platform
Labels & Selectors
@meteatamel
Google Cloud Platform
Arbitrary metadata
Attached to any API object
Generally represent identity
Queryable by selectors
• think SQL ‘select ... where ...’
The only grouping mechanism
• pods under a ReplicationController
• pods in a Service
• capabilities of a node (constraints)
Labels @meteatamel
Google Cloud Platform
App: MyApp
Phase: prod
Role: FE
App: MyApp
Phase: test
Role: FE
App: MyApp
Phase: prod
Role: BE
App: MyApp
Phase: test
Role: BE
Selectors @meteatamel
Google Cloud Platform
App: MyApp
Phase: prod
Role: FE
App: MyApp
Phase: test
Role: FE
App: MyApp
Phase: prod
Role: BE
App: MyApp
Phase: test
Role: BE
App = MyApp
Selectors @meteatamel
Google Cloud Platform
App: MyApp
Phase: prod
Role: FE
App: MyApp
Phase: test
Role: FE
App: MyApp
Phase: prod
Role: BE
App: MyApp
Phase: test
Role: BE
App = MyApp, Role = FE
Selectors @meteatamel
Google Cloud Platform
App: MyApp
Phase: prod
Role: FE
App: MyApp
Phase: test
Role: FE
App: MyApp
Phase: prod
Role: BE
App: MyApp
Phase: test
Role: BE
App = MyApp, Role = BE
Selectors @meteatamel
Google Cloud Platform
App: MyApp
Phase: prod
Role: FE
App: MyApp
Phase: test
Role: FE
App: MyApp
Phase: prod
Role: BE
App: MyApp
Phase: test
Role: BE
App = MyApp, Phase = prod
Selectors @meteatamel
Google Cloud Platform
App: MyApp
Phase: prod
Role: FE
App: MyApp
Phase: test
Role: FE
App: MyApp
Phase: prod
Role: BE
App: MyApp
Phase: test
Role: BE
App = MyApp, Phase = test
Selectors @meteatamel
Google Cloud Platform
Deployment
Pod
Volume
Label
Selector
Kubernetes Terminology
ReplicaSet
Liveness Probe
Readiness Probe
Service
DaemonSet
Job
StatefulSet
ConfigMap
Secret
Google Cloud Platform
Resiliency & Redundancy
@meteatamel
Google Cloud Platform
A simple control loop
Runs out-of-process wrt API server
One job: ensure N copies of a pod
• grouped by a selector
• too few? start some
• too many? kill some
Layered on top of the public Pod API
Replicated pods are fungible
• No implied order or identity
* The evolution of ReplicationControllers
ReplicaSet
- name = “my-rc”
- selector = {“App”: “MyApp”}
- template = { ... }
- replicas = 4
API Server
How
many?
3
Start 1
more
OK
How
many?
4
ReplicaSets* @meteatamel
Google Cloud Platform
ReplicaSets
Replication
Controller Pod
frontend
Pod
frontend
app = demo app = demo app = demo
ReplicaSet
#pods = 3
app = demo
color in (blue,grey)
show: version = v2
color = blue color = blue color = grey
Behavior Benefits
● Keeps Pods running
● Gives direct control of Pod #s
● Grouped by Label Selector
➔ Recreates Pods, maintains desired state
➔ Fine-grained control for scaling
➔ Standard grouping semantics
Pod Pod Pod
@meteatamel
Google Cloud Platform
Demo: ReplicaSets
@meteatamel
Google Cloud Platform
Kubernetes Health Checks
@meteatamel
Google Cloud Platform
It’s your responsibility to let Kubernetes know whether your app is healthy or not!
Health Check Philosophy
Google Cloud Platform
Liveness Probes make sure your application is running
livenessProbe:
# an http probe
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15 # wait 15 seconds after pod is started to check for health
timeoutSeconds: 1 # wait 1 second for a response to health check
Liveness Probes
Google Cloud Platform
Readiness probes make sure your application is ready to serve traffic
readinessProbe:
# an http probe
httpGet:
path: /readiness
port: 8080
initialDelaySeconds: 20 # wait 20 seconds after pod is started to check for health
timeoutSeconds: 5 # wait 5 second for a response to health check
Readiness Probes
Google Cloud Platform
Deployment
Pod
Volume
Label
Selector
Kubernetes Terminology
ReplicaSet
Liveness Probe
Readiness Probe
Service
DaemonSet
Job
StatefulSet
ConfigMap
Secret
Google Cloud Platform
Services
@meteatamel
Google Cloud Platform
Services
Client
Pod
Container
Pod
Container
Pod
Container
A logical grouping of pods that perform the
same function (the Service’s endpoints)
• grouped by label selector
Load balances incoming requests across
constituent pods
Choice of pod is random but supports
session affinity (ClientIP)
Gets a stable virtual IP and port
• also a DNS nametype =
Service
Label selector:
type = FE
VIP
type = FE type = FE type = FE
@meteatamel
Google Cloud Platform
Demo: Services
@meteatamel
Google Cloud Platform
A general purpose, web-based UI to view/manage Kubernetes clusters
Kubernetes Dashboard
Google Cloud Platform
Demo: Kubernetes Dashboard
Google Cloud Platform
Deployment
Pod
Volume
Label
Selector
Kubernetes Terminology
ReplicaSet
Liveness Probe
Readiness Probe
Service
DaemonSet
Job
StatefulSet
ConfigMap
Secret
Google Cloud Platform
Scaling
@meteatamel
Google Cloud Platform
Scaling @meteatamel
Service
Label selectors:
version = 1.0
type = Frontend
Service
name = frontend
Label selector:
type = BE
Replication
Controller Pod
frontend
Pod
version= v1 version = v1
ReplicaSet
version = v1
#pods = 1
show: version = v2
type = FE type = FE
Pod
frontend
Pod
version = v1
type = FE
ReplicaSet
version = v1
#pods = 2
show: version = v2
Pod
ReplicaSet
version = v1
type = FE
#pods = 3
show: version = v2
Google Cloud Platform
Scaling @meteatamel
Service
Label selectors:
version = 1.0
type = Frontend
Service
name = frontend
Label selector:
type = BE
Replication
Controller Pod
frontend
Pod
version= v1 version = v1
ReplicaSet
version = v1
#pods = 1
show: version = v2
type = FE type = FE
Pod
frontend
Pod
version = v1
type = FE
ReplicaSet
version = v1
#pods = 2
show: version = v2
Pod Pod
ReplicaSet
version = v1
type = FE
#pods = 4
show: version = v2
version = v1
type = FE
Google Cloud Platform
Demo: Scaling
@meteatamel
Google Cloud Platform
Rolling Update
@meteatamel
Google Cloud Platform
ReplicaSet
- name: my-app-v1
- replicas: 3
- selector:
- app: MyApp
- version: v1
Service
- app: MyApp
Rolling Update @meteatamel
Google Cloud Platform
ReplicaSet
- name: my-app-v1
- replicas: 3
- selector:
- app: MyApp
- version: v1
ReplicaSet
- name: my-app-v2
- replicas: 0
- selector:
- app: MyApp
- version: v2
Service
- app: MyApp
Rolling Update @meteatamel
Google Cloud Platform
ReplicaSet
- name: my-app-v1
- replicas: 3
- selector:
- app: MyApp
- version: v1
ReplicaSet
- name: my-app-v2
- replicas: 1
- selector:
- app: MyApp
- version: v2
Service
- app: MyApp
Rolling Update @meteatamel
Google Cloud Platform
ReplicaSet
- name: my-app-v1
- replicas: 2
- selector:
- app: MyApp
- version: v1
ReplicaSet
- name: my-app-v2
- replicas: 1
- selector:
- app: MyApp
- version: v2
Service
- app: MyApp
Rolling Update @meteatamel
Google Cloud Platform
ReplicaSet
- name: my-app-v1
- replicas: 2
- selector:
- app: MyApp
- version: v1
ReplicaSet
- name: my-app-v2
- replicas: 2
- selector:
- app: MyApp
- version: v2
Service
- app: MyApp
Rolling Update @meteatamel
Google Cloud Platform
ReplicaSet
- name: my-app-v1
- replicas: 1
- selector:
- app: MyApp
- version: v1
ReplicaSet
- name: my-app-v2
- replicas: 2
- selector:
- app: MyApp
- version: v2
Service
- app: MyApp
Rolling Update @meteatamel
Google Cloud Platform
ReplicaSet
- name: my-app-v1
- replicas: 1
- selector:
- app: MyApp
- version: v1
ReplicaSet
- name: my-app-v2
- replicas: 3
- selector:
- app: MyApp
- version: v2
Service
- app: MyApp
Rolling Update @meteatamel
Google Cloud Platform
ReplicaSet
- name: my-app-v1
- replicas: 0
- selector:
- app: MyApp
- version: v1
ReplicaSet
- name: my-app-v2
- replicas: 3
- selector:
- app: MyApp
- version: v2
Service
- app: MyApp
Rolling Update @meteatamel
Google Cloud Platform
ReplicaSet
- name: my-app-v2
- replicas: 3
- selector:
- app: MyApp
- version: v2
Service
- app: MyApp
Rolling Update @meteatamel
Google Cloud Platform
Demo: Rolling Update
@meteatamel
Google Cloud Platform
Canary Deployments
Replication
Controller
ReplicaSet
version = v2
type = BE
#pods = 1
show: version = v2
Pod
frontend
Pod
version = v2
type = BE
@meteatamel
Pod
frontend
Service
Label selectors:
version = 1.0
type = Frontend
Service
name = backend
Label selector:
type = BE
Replication
Controller
Pod
version= v1
ReplicaSet
version = v1
type = BE
#pods = 2
show: version = v2
type = BE type = BE
Pod
version = v1
Google Cloud Platform
Autoscaling
Replication
Controller Pod
frontend
Pod
name=locust name=locust
ReplicaSet
name=locust
role=worker
#pods = 1
show: version = v2
Pod
frontend
Pod
name=locust
ReplicaSet
name=locust
role=worker
#pods = 2
show: version = v2
Pod Pod
name=locust
role=worker role=worker role=worker role=worker
ReplicaSet
name=locust
role=worker
#pods = 4
Heapster
70% CPU
40% CPU
Scale
CPU Target% = 50
> 50% CPU
@meteatamel
Google Cloud Platform
DaemonSets
@meteatamel
Google Cloud Platform
Problem: how to run a Pod on every node?
• or a subset of nodes
Similar to ReplicaSet
• principle: do one thing, don’t overload
“Which nodes?” is a selector
Use familiar tools and patterns
Pod
DaemonSets @meteatamel
Google Cloud Platform
Jobs
@meteatamel
Google Cloud Platform
Run-to-completion, as opposed to run-forever
• Express parallelism vs. required completions
• Workflow: restart on failure
• Build/test: don’t restart on failure
Aggregates success/failure counts
Built for batch and big-data work
...
Jobs @meteatamel
Google Cloud Platform
StatefulSets
@meteatamel
Google Cloud Platform
Goal: enable clustered software on Kubernetes
• mysql, redis, zookeeper, ...
Clustered apps need “identity” and sequencing
guarantees
• stable hostname, available in DNS
• an ordinal index
• stable storage: linked to the ordinal & hostname
• discovery of peers for quorum
• startup/teardown ordering
StatefulSets @meteatamel
Google Cloud Platform
ConfigMaps
@meteatamel
Google Cloud Platform
Goal: manage app configuration
• ...without making overly-brittle container images
12-factor says config comes from the
environment
• Kubernetes is the environment
Manage config via the Kubernetes API
Inject config as a virtual volume into your Pods
• late-binding, live-updated (atomic)
• also available as env vars
node
API
Pod Config
Map
ConfigMaps @meteatamel
Google Cloud Platform
Secrets
@meteatamel
Google Cloud Platform
Goal: grant a pod access to a secured something
• don’t put secrets in the container image!
12-factor says config comes from the
environment
• Kubernetes is the environment
Manage secrets via the Kubernetes API
Inject secrets as virtual volumes into your Pods
• late-binding, tmpfs - never touches disk
• also available as env vars
node
API
Pod Secret
Secrets @meteatamel
Google Cloud Platform
Deployment
Pod
Volume
Label
Selector
Kubernetes Terminology
ReplicaSet
Liveness Probe
Readiness Probe
Service
DaemonSet
Job
StatefulSet
ConfigMap
Secret
Confidential & ProprietaryGoogle Cloud Platform 99
There is more!
@meteatamel
Confidential & ProprietaryGoogle Cloud Platform 100
kubernetes.io
cloud.google.com/container-engine
Mete Atamel
@meteatamel
atamel@google.com
meteatamel.wordpress.com
Thank You
@meteatamel
Send talk feedback
bit.ly/atamel

More Related Content

What's hot (20)

PDF
Why SQL? | Kenny Gorman, Cloudera
HostedbyConfluent
 
PPTX
Kafka Summit 2019 Microservice Orchestration
larsfrancke
 
PDF
Kafka summit apac session
Christina Lin
 
PPTX
Crap. Your Big Data Kitchen Is Broken.
Altoros
 
PPTX
Episode 3: Kubernetes and Big Data Services
Mesosphere Inc.
 
PDF
Google Cloud Platform
GeneXus
 
PPTX
Introduction to ibm cloud paks concept license and minimum config public
Petchpaitoon Krungwong
 
PDF
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
tdc-globalcode
 
PDF
Intro - Cloud Native
Albert Suwandhi
 
PPTX
Intro to Docker Containers and the Oracle Platform – Database, WebLogic &Clo...
Lucas Jellema
 
PPTX
CNCF Introduction - Feb 2018
Krishna-Kumar
 
PDF
RedisConf18 - Redis in Dev, Test, and Prod with the OpenShift Service Catalog
Redis Labs
 
PPTX
How to migrate workloads to the google cloud platform
actualtechmedia
 
PDF
Big data and Kubernetes
Anirudh Ramanathan
 
PDF
GDG Cloud Southlake #8 Steve Cravens: Infrastructure as-Code (IaC) in 2022: ...
James Anderson
 
PPTX
'Cloud-Native' Ecosystem - Aug 2015
Lenny Pruss
 
PPTX
Hadoop on Docker
Rakesh Saha
 
PDF
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Daniel Krook
 
PPTX
Navigating the obdervability storm with Kafka | Jose Manuel Cristobal, Adidas
HostedbyConfluent
 
PDF
Dev309 from asgard to zuul - netflix oss-final
Ruslan Meshenberg
 
Why SQL? | Kenny Gorman, Cloudera
HostedbyConfluent
 
Kafka Summit 2019 Microservice Orchestration
larsfrancke
 
Kafka summit apac session
Christina Lin
 
Crap. Your Big Data Kitchen Is Broken.
Altoros
 
Episode 3: Kubernetes and Big Data Services
Mesosphere Inc.
 
Google Cloud Platform
GeneXus
 
Introduction to ibm cloud paks concept license and minimum config public
Petchpaitoon Krungwong
 
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
tdc-globalcode
 
Intro - Cloud Native
Albert Suwandhi
 
Intro to Docker Containers and the Oracle Platform – Database, WebLogic &Clo...
Lucas Jellema
 
CNCF Introduction - Feb 2018
Krishna-Kumar
 
RedisConf18 - Redis in Dev, Test, and Prod with the OpenShift Service Catalog
Redis Labs
 
How to migrate workloads to the google cloud platform
actualtechmedia
 
Big data and Kubernetes
Anirudh Ramanathan
 
GDG Cloud Southlake #8 Steve Cravens: Infrastructure as-Code (IaC) in 2022: ...
James Anderson
 
'Cloud-Native' Ecosystem - Aug 2015
Lenny Pruss
 
Hadoop on Docker
Rakesh Saha
 
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Daniel Krook
 
Navigating the obdervability storm with Kafka | Jose Manuel Cristobal, Adidas
HostedbyConfluent
 
Dev309 from asgard to zuul - netflix oss-final
Ruslan Meshenberg
 

Viewers also liked (20)

PDF
Microservices with Docker, Kubernetes, and Jenkins
Red Hat Developers
 
PDF
Red Hat OpenShift Container Platform Overview
James Falkner
 
PDF
Red Hat Container Strategy
Red Hat Events
 
PDF
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Etsuji Nakai
 
PDF
An Introduction to Kubernetes
Imesh Gunaratne
 
PPTX
OpenShift Enterprise 3.1 vs kubernetes
Samuel Terburg
 
PDF
How to secure and manage modern IT - Ondrej Vysek
ITCamp
 
PDF
The best of Windows Server 2016 - Thomas Maurer
ITCamp
 
PDF
Scaling face recognition with big data - Bogdan Bocse
ITCamp
 
PDF
ITCamp 2017 - Florin Coros - Decide between In-Process or Inter-Processes Com...
ITCamp
 
PDF
ITCamp 2017 - Raffaele Rialdi - A Deep Dive Into Bridging Node-js with .NET Core
ITCamp
 
PDF
Forget Process, Focus on People - Peter Leeson
ITCamp
 
PDF
Great all this new stuff, but how do I convince my management - Erwin Derksen
ITCamp
 
PDF
The best of Hyper-V 2016 - Thomas Maurer
ITCamp
 
PDF
Testing your PowerShell code with Pester - Florin Loghiade
ITCamp
 
PDF
From Developer to Data Scientist - Gaines Kergosien
ITCamp
 
PPTX
One Azure Monitor to Rule Them All? (IT Camp 2017, Cluj, RO)
Marius Zaharia
 
PDF
Migrating to Continuous Delivery with TFS 2017 - Liviu Mandras-Iura
ITCamp
 
PDF
The Secret of Engaging Presentations - Boris Hristov
ITCamp
 
PDF
Columnstore indexes - best practices for the ETL process - Damian Widera
ITCamp
 
Microservices with Docker, Kubernetes, and Jenkins
Red Hat Developers
 
Red Hat OpenShift Container Platform Overview
James Falkner
 
Red Hat Container Strategy
Red Hat Events
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Etsuji Nakai
 
An Introduction to Kubernetes
Imesh Gunaratne
 
OpenShift Enterprise 3.1 vs kubernetes
Samuel Terburg
 
How to secure and manage modern IT - Ondrej Vysek
ITCamp
 
The best of Windows Server 2016 - Thomas Maurer
ITCamp
 
Scaling face recognition with big data - Bogdan Bocse
ITCamp
 
ITCamp 2017 - Florin Coros - Decide between In-Process or Inter-Processes Com...
ITCamp
 
ITCamp 2017 - Raffaele Rialdi - A Deep Dive Into Bridging Node-js with .NET Core
ITCamp
 
Forget Process, Focus on People - Peter Leeson
ITCamp
 
Great all this new stuff, but how do I convince my management - Erwin Derksen
ITCamp
 
The best of Hyper-V 2016 - Thomas Maurer
ITCamp
 
Testing your PowerShell code with Pester - Florin Loghiade
ITCamp
 
From Developer to Data Scientist - Gaines Kergosien
ITCamp
 
One Azure Monitor to Rule Them All? (IT Camp 2017, Cluj, RO)
Marius Zaharia
 
Migrating to Continuous Delivery with TFS 2017 - Liviu Mandras-Iura
ITCamp
 
The Secret of Engaging Presentations - Boris Hristov
ITCamp
 
Columnstore indexes - best practices for the ETL process - Damian Widera
ITCamp
 
Ad

Similar to Resilient microservices with Kubernetes - Mete Atamel (20)

PDF
Containerised ASP.NET Core apps with Kubernetes
Codemotion Tel Aviv
 
PDF
Mete Atamel
CodeFest
 
PDF
Resilient microservices with Kubernetes - Mete Atamel - Codemotion Rome 2017
Codemotion
 
PDF
Mete Atamel "Resilient microservices with kubernetes"
IT Event
 
PDF
Net core, mssql, container und kubernetes
Thomas Fricke
 
PDF
Cluster api devopscon berlin
Guus van Weelden
 
PDF
Webinar- Tea for the Tillerman
Cumulus Networks
 
PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
PDF
Flink Forward SF 2017: James Malone - Make The Cloud Work For You
Flink Forward
 
PDF
Kubernetes for Java Developers
Anthony Dahanne
 
PPTX
Kubernetes @ meetic
Sébastien Le Gall
 
PDF
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
NETWAYS
 
PPTX
Google Cloud Fundamentals by CloudZone
Idan Tohami
 
PDF
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
Kumton Suttiraksiri
 
PDF
Where should I run my code? Serverless, Containers, Virtual Machines and more
Bret McGowen - NYC Google Developer Advocate
 
PPTX
Introduction to Kubernetes
Vishal Biyani
 
PDF
Monitoring kubernetes across data center and cloud
Datadog
 
PDF
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Anthony Dahanne
 
PDF
Containerized architectures for deep learning
Antje Barth
 
PDF
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
Radhika Puthiyetath
 
Containerised ASP.NET Core apps with Kubernetes
Codemotion Tel Aviv
 
Mete Atamel
CodeFest
 
Resilient microservices with Kubernetes - Mete Atamel - Codemotion Rome 2017
Codemotion
 
Mete Atamel "Resilient microservices with kubernetes"
IT Event
 
Net core, mssql, container und kubernetes
Thomas Fricke
 
Cluster api devopscon berlin
Guus van Weelden
 
Webinar- Tea for the Tillerman
Cumulus Networks
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
VMUG IT
 
Flink Forward SF 2017: James Malone - Make The Cloud Work For You
Flink Forward
 
Kubernetes for Java Developers
Anthony Dahanne
 
Kubernetes @ meetic
Sébastien Le Gall
 
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
NETWAYS
 
Google Cloud Fundamentals by CloudZone
Idan Tohami
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
Kumton Suttiraksiri
 
Where should I run my code? Serverless, Containers, Virtual Machines and more
Bret McGowen - NYC Google Developer Advocate
 
Introduction to Kubernetes
Vishal Biyani
 
Monitoring kubernetes across data center and cloud
Datadog
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Anthony Dahanne
 
Containerized architectures for deep learning
Antje Barth
 
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
Radhika Puthiyetath
 
Ad

More from ITCamp (20)

PDF
ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
ITCamp
 
PDF
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
ITCamp
 
PDF
ITCamp 2019 - Peter Leeson - Managing Skills
ITCamp
 
PPTX
ITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
ITCamp
 
PDF
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp
 
PDF
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp
 
PPTX
ITCamp 2019 - Florin Loghiade - Azure Kubernetes in Production - Field notes...
ITCamp
 
PPTX
ITCamp 2019 - Florin Flestea - How 3rd Level support experience influenced m...
ITCamp
 
PPTX
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
ITCamp
 
PPTX
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
ITCamp
 
PPTX
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
ITCamp
 
PPTX
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
ITCamp
 
PPTX
ITCamp 2019 - Andy Cross - Business Outcomes from AI
ITCamp
 
PDF
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
ITCamp
 
PDF
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
ITCamp
 
PPTX
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
ITCamp
 
PPTX
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
ITCamp
 
PDF
ITCamp 2019 - Peter Leeson - Vitruvian Quality
ITCamp
 
PDF
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
ITCamp
 
PDF
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
ITCamp
 
ITCamp 2019 - Stacey M. Jenkins - Protecting your company's data - By psychol...
ITCamp
 
ITCamp 2019 - Silviu Niculita - Supercharge your AI efforts with the use of A...
ITCamp
 
ITCamp 2019 - Peter Leeson - Managing Skills
ITCamp
 
ITCamp 2019 - Mihai Tataran - Governing your Cloud Resources
ITCamp
 
ITCamp 2019 - Ivana Milicic - Color - The Shadow Ruler of UX
ITCamp
 
ITCamp 2019 - Florin Coros - Implementing Clean Architecture
ITCamp
 
ITCamp 2019 - Florin Loghiade - Azure Kubernetes in Production - Field notes...
ITCamp
 
ITCamp 2019 - Florin Flestea - How 3rd Level support experience influenced m...
ITCamp
 
ITCamp 2019 - Emil Craciun - RoboRestaurant of the future powered by serverle...
ITCamp
 
ITCamp 2019 - Eldert Grootenboer - Cloud Architecture Recipes for The Enterprise
ITCamp
 
ITCamp 2019 - Cristiana Fernbach - Blockchain Legal Trends
ITCamp
 
ITCamp 2019 - Andy Cross - Machine Learning with ML.NET and Azure Data Lake
ITCamp
 
ITCamp 2019 - Andy Cross - Business Outcomes from AI
ITCamp
 
ITCamp 2019 - Andrea Saltarello - Modernise your app. The Cloud Story
ITCamp
 
ITCamp 2019 - Andrea Saltarello - Implementing bots and Alexa skills using Az...
ITCamp
 
ITCamp 2019 - Alex Mang - I'm Confused Should I Orchestrate my Containers on ...
ITCamp
 
ITCamp 2019 - Alex Mang - How Far Can Serverless Actually Go Now
ITCamp
 
ITCamp 2019 - Peter Leeson - Vitruvian Quality
ITCamp
 
ITCamp 2018 - Ciprian Sorlea - Million Dollars Hello World Application
ITCamp
 
ITCamp 2018 - Ciprian Sorlea - Enterprise Architectures with TypeScript And F...
ITCamp
 

Recently uploaded (20)

PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 

Resilient microservices with Kubernetes - Mete Atamel

  • 1. Resilient Microservices with Kubernetes Mete Atamel Developer Advocate for Google Cloud @meteatamel
  • 2. Confidential & ProprietaryGoogle Cloud Platform 2 Mete Atamel Developer Advocate for Google Cloud @meteatamel [email protected] meteatamel.wordpress.com Please send talk feedback: bit.ly/atamel
  • 3. Google Cloud Platform The .NET Revolution @meteatamel
  • 4. Google Cloud Platform The world of 2014 ASP.NET C# Visual Studio SQL Server PowerShell Java Apache MySQL Eclipse Bash @meteatamel
  • 5. Google Cloud Platform Things are changing @meteatamel ASP.NET Core on Linux, Mac, Windows Microsoft joins Linux foundation Google joins .NET foundation 2014 .NET Goes Open Source OpenSSH on Windows Ubuntu, Debian on Azure 2015 SQL Server on Linux Bash on Windows PowerShell on Linux 2016
  • 6. Google Cloud Platform The convergence ASP.NET C# Visual Studio SQL Server Java ApacheMySQL PowerShell Eclipse Bash
  • 7. Confidential & ProprietaryGoogle Cloud Platform 7 Great time to be a .NET developer!
  • 8. Confidential & ProprietaryGoogle Cloud Platform 8 However, software development is HARD! @meteatamel And it is not getting any easier...
  • 9. Google Cloud Platform In the good old days @meteatamel This is all I had to care... Image Source: Wikipedia Life was good :-)
  • 10. Google Cloud Platform A lot happened since then Internet App Servers Web Servers Databases Microservices The Monolith Object Oriented Programming Version Control Caching Cloud Computing Firewalls Virtual Machines Big Data Machine Learning Mobile DevOps IoT
  • 11. Google Cloud Platform Nowadays ZONE A Load Balancer Health Endpoint Health Endpoint Health Endpoint Health Checker ZONE B Load Balancer Health Endpoint Health Endpoint Health Endpoint Health Checker REPLICATION Task Queues Autoscaler
  • 12. Google Cloud Platform Maintaining code in different languages on different types of machines Rolling out the new version of your code reliably Rolling back to the old version if something goes wrong Managing configuration and secrets Managing scripts that need to run on each machine We haven’t even talked about
  • 13. Google Cloud Platform I just want to write some code to solve a real-world problem @meteatamel
  • 14. Google Cloud Platform The reality ZONE A Load Balancer Health Endpoint Health Endpoint Health Endpoint Health Checker ZONE B Load Balancer Health Endpoint Health Endpoint Health Endpoint Health Checker REPLICATION Task Queues Autoscaler This is all I want to care This is all I have to care What do we do?
  • 15. Google Cloud Platform In the good old days @meteatamel Write your code, pass it to QA for testing, let operations team run it...
  • 16. Google Cloud Platform Nowadays, it is your problem What do we do?
  • 17. Google Cloud Platform You can write your code in any language and run anywhere exactly the same way @meteatamel Your app is optimally deployed somewhere and managed by someone. It just works! There are no machines. All resources are automatically provisioned on demand
  • 18. Google Cloud Platform Write your code in any language and run it anywhere exactly the same way ⇒ Containers (eg. Docker, Rkt) Your app is optimally deployed and managed ⇒ Container Management Platforms (eg. Kubernetes, Docker Swarm, Mesos) All the resources needed for your app is automatically provisioned per demand ⇒ Cloud Providers (eg. Google Cloud, AWS, Azure) Docker + Kubernetes + Cloud
  • 19. Google Cloud Platform Demo: Simple Microservice @meteatamel
  • 21. Google Cloud Platform ✕ No isolation ✕ Common libs ✕ Highly coupled Apps & OS Why containers? app libs kernel libs app app kernel app libs libs kernel kernel libs app kernel libs app libs app libs app ✓ Isolation ✓ No Common Libs ✕ Expensive and Inefficient ✕ Hard to manage ✓ Isolation ✓ No Common Libs ✓ Less overhead ✕ Less Dependency on Host OS kernel libs app app app app Physical Machine Virtual Machines Containers @meteatamel
  • 22. Google Cloud Platform What is a container? Lightweight Hermetically sealed Isolated Easily deployable Introspectable Composable Linux (or Windows) processes A lightweight way to virtualize applications @meteatamel Docker
  • 23. Google Cloud Platform Google has been developing and using containers to manage our applications for over 12 years. Images by Connie Zhou @meteatamel
  • 24. Google Cloud Platform Everything at Google runs in containers Gmail, Web Search, Maps, ... MapReduce, batch, ... GFS, Colossus, ... Even Google’s Cloud Platform: our VMs run in containers! We launch over 2 billion containers per week @meteatamel
  • 25. Google Cloud Platform Demo: Containerised Microservice @meteatamel
  • 26. Google Cloud Platform Containers not enough @meteatamel Containers help to create a lightweight and consistent environment for apps ● Who takes care of redundancy? ● Who takes care of resiliency? ● Who scales up/down your app? ● Who and how a new version of your app gets deployed? ● Who rolls back to a previous version if something goes wrong? ● Etc. etc. etc. But you still need to answer these questions:
  • 28. Google Cloud Platform 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 (borg) • Supports multiple cloud and bare-metal environments • Supports multiple container runtimes • 100% Open source, written in Go Manage applications, not machines Kubernetes @meteatamel
  • 29. Google Cloud Platform kubelet UI kubeletCLI API users master nodes etcd kubelet scheduler controllers apiserver The 10000 foot view @meteatamel
  • 30. Google Cloud Platform UI API Container Cluster All you really care about @meteatamel
  • 31. Google Cloud Platform 1. Setting up the cluster • Choose a cloud: GCE, AWS, Azure, Rackspace, on-premises, ... • Choose a node OS: CoreOS, Atomic, RHEL, Debian, CentOS, Ubuntu, ... • Provision machines: Boot VMs, install and run kube components, ... • Configure networking: IP ranges for Pods, Services, SDN, ... • Start cluster services: DNS, logging, monitoring, ... • Manage nodes: kernel upgrades, OS updates, hardware failures... Not the easy or fun part, but unavoidable This is where things like Google Container Engine (GKE) really help Container clusters: A story in two parts @meteatamel
  • 32. Google Cloud Platform Kubernetes cluster on GKE @meteatamel
  • 33. Google Cloud Platform Windows Server Node in Kubernetes
  • 34. Google Cloud Platform Demo: Create Kubernetes cluster @meteatamel
  • 35. Google Cloud Platform 2. Using the cluster • Run Pods & Containers • Replica Sets • Services • Volumes This is the fun part! A distinct set of problems from cluster setup and management Don’t make developers deal with cluster administration! Accelerate development by focusing on the applications, not the cluster Container clusters: A story in two parts @meteatamel
  • 36. Google Cloud Platform Kubernetes Building Blocks @meteatamel
  • 37. Google Cloud Platform Deployment Pod Volume Label Selector Kubernetes Terminology ReplicaSet Liveness Probe Readiness Probe Service DaemonSet Job StatefulSet ConfigMap Secret
  • 38. Container cluster Service Pods Each pod containers one or more containers Nodes Role: frontend Role: frontend Role: frontend Role: frontend Replication controller Replicas: 3 Env: prod microservice labels Service communication channel Blueprint “pod template” Env: prod Env: prod Env: prod registry containers @meteatamel
  • 40. Google Cloud Platform A Deployment provides declarative updates for Pods and Replica Sets Describe the desired state and the Deployment controller will change the actual state to the desired state at a controlled rate for you. Deployment manages replica changes for you • stable object name • updates are configurable, done server-side • kubectl edit or kubectl apply ... Deployments @meteatamel
  • 41. Google Cloud Platform Demo: Create Deployment @meteatamel
  • 42. Google Cloud Platform Deployment Pod Volume Label Selector Kubernetes Terminology ReplicaSet Liveness Probe Readiness Probe Service DaemonSet Job StatefulSet ConfigMap Secret
  • 43. Google Cloud Platform Pods and Volumes @meteatamel
  • 44. Google Cloud Platform Small group of containers & volumes Tightly coupled The atom of scheduling & placement Shared namespace • share IP address & localhost • share IPC, etc. Managed lifecycle • bound to a node, restart in place • can die, cannot be reborn with same ID Example: data puller & web server Consumers Content Manager File Puller Web Server Volume Pod Pods @meteatamel
  • 45. Google Cloud Platform Pod-scoped storage Support many types of volume plugins • Empty dir (and tmpfs) • Host path • Git repository • GCE Persistent Disk • AWS Elastic Block Store • Azure File Storage • iSCSI • Flocker • NFS • vSphere • GlusterFS • Ceph File and RBD • Cinder • FibreChannel • Secret, ConfigMap, DownwardAPI • Flex (exec a binary) • ... Volumes @meteatamel
  • 46. Google Cloud Platform Deployment Pod Volume Label Selector Kubernetes Terminology ReplicaSet Liveness Probe Readiness Probe Service DaemonSet Job StatefulSet ConfigMap Secret
  • 47. Google Cloud Platform Labels & Selectors @meteatamel
  • 48. Google Cloud Platform Arbitrary metadata Attached to any API object Generally represent identity Queryable by selectors • think SQL ‘select ... where ...’ The only grouping mechanism • pods under a ReplicationController • pods in a Service • capabilities of a node (constraints) Labels @meteatamel
  • 49. Google Cloud Platform App: MyApp Phase: prod Role: FE App: MyApp Phase: test Role: FE App: MyApp Phase: prod Role: BE App: MyApp Phase: test Role: BE Selectors @meteatamel
  • 50. Google Cloud Platform App: MyApp Phase: prod Role: FE App: MyApp Phase: test Role: FE App: MyApp Phase: prod Role: BE App: MyApp Phase: test Role: BE App = MyApp Selectors @meteatamel
  • 51. Google Cloud Platform App: MyApp Phase: prod Role: FE App: MyApp Phase: test Role: FE App: MyApp Phase: prod Role: BE App: MyApp Phase: test Role: BE App = MyApp, Role = FE Selectors @meteatamel
  • 52. Google Cloud Platform App: MyApp Phase: prod Role: FE App: MyApp Phase: test Role: FE App: MyApp Phase: prod Role: BE App: MyApp Phase: test Role: BE App = MyApp, Role = BE Selectors @meteatamel
  • 53. Google Cloud Platform App: MyApp Phase: prod Role: FE App: MyApp Phase: test Role: FE App: MyApp Phase: prod Role: BE App: MyApp Phase: test Role: BE App = MyApp, Phase = prod Selectors @meteatamel
  • 54. Google Cloud Platform App: MyApp Phase: prod Role: FE App: MyApp Phase: test Role: FE App: MyApp Phase: prod Role: BE App: MyApp Phase: test Role: BE App = MyApp, Phase = test Selectors @meteatamel
  • 55. Google Cloud Platform Deployment Pod Volume Label Selector Kubernetes Terminology ReplicaSet Liveness Probe Readiness Probe Service DaemonSet Job StatefulSet ConfigMap Secret
  • 56. Google Cloud Platform Resiliency & Redundancy @meteatamel
  • 57. Google Cloud Platform A simple control loop Runs out-of-process wrt API server One job: ensure N copies of a pod • grouped by a selector • too few? start some • too many? kill some Layered on top of the public Pod API Replicated pods are fungible • No implied order or identity * The evolution of ReplicationControllers ReplicaSet - name = “my-rc” - selector = {“App”: “MyApp”} - template = { ... } - replicas = 4 API Server How many? 3 Start 1 more OK How many? 4 ReplicaSets* @meteatamel
  • 58. Google Cloud Platform ReplicaSets Replication Controller Pod frontend Pod frontend app = demo app = demo app = demo ReplicaSet #pods = 3 app = demo color in (blue,grey) show: version = v2 color = blue color = blue color = grey Behavior Benefits ● Keeps Pods running ● Gives direct control of Pod #s ● Grouped by Label Selector ➔ Recreates Pods, maintains desired state ➔ Fine-grained control for scaling ➔ Standard grouping semantics Pod Pod Pod @meteatamel
  • 59. Google Cloud Platform Demo: ReplicaSets @meteatamel
  • 60. Google Cloud Platform Kubernetes Health Checks @meteatamel
  • 61. Google Cloud Platform It’s your responsibility to let Kubernetes know whether your app is healthy or not! Health Check Philosophy
  • 62. Google Cloud Platform Liveness Probes make sure your application is running livenessProbe: # an http probe httpGet: path: /healthz port: 8080 initialDelaySeconds: 15 # wait 15 seconds after pod is started to check for health timeoutSeconds: 1 # wait 1 second for a response to health check Liveness Probes
  • 63. Google Cloud Platform Readiness probes make sure your application is ready to serve traffic readinessProbe: # an http probe httpGet: path: /readiness port: 8080 initialDelaySeconds: 20 # wait 20 seconds after pod is started to check for health timeoutSeconds: 5 # wait 5 second for a response to health check Readiness Probes
  • 64. Google Cloud Platform Deployment Pod Volume Label Selector Kubernetes Terminology ReplicaSet Liveness Probe Readiness Probe Service DaemonSet Job StatefulSet ConfigMap Secret
  • 66. Google Cloud Platform Services Client Pod Container Pod Container Pod Container A logical grouping of pods that perform the same function (the Service’s endpoints) • grouped by label selector Load balances incoming requests across constituent pods Choice of pod is random but supports session affinity (ClientIP) Gets a stable virtual IP and port • also a DNS nametype = Service Label selector: type = FE VIP type = FE type = FE type = FE @meteatamel
  • 67. Google Cloud Platform Demo: Services @meteatamel
  • 68. Google Cloud Platform A general purpose, web-based UI to view/manage Kubernetes clusters Kubernetes Dashboard
  • 69. Google Cloud Platform Demo: Kubernetes Dashboard
  • 70. Google Cloud Platform Deployment Pod Volume Label Selector Kubernetes Terminology ReplicaSet Liveness Probe Readiness Probe Service DaemonSet Job StatefulSet ConfigMap Secret
  • 72. Google Cloud Platform Scaling @meteatamel Service Label selectors: version = 1.0 type = Frontend Service name = frontend Label selector: type = BE Replication Controller Pod frontend Pod version= v1 version = v1 ReplicaSet version = v1 #pods = 1 show: version = v2 type = FE type = FE Pod frontend Pod version = v1 type = FE ReplicaSet version = v1 #pods = 2 show: version = v2 Pod ReplicaSet version = v1 type = FE #pods = 3 show: version = v2
  • 73. Google Cloud Platform Scaling @meteatamel Service Label selectors: version = 1.0 type = Frontend Service name = frontend Label selector: type = BE Replication Controller Pod frontend Pod version= v1 version = v1 ReplicaSet version = v1 #pods = 1 show: version = v2 type = FE type = FE Pod frontend Pod version = v1 type = FE ReplicaSet version = v1 #pods = 2 show: version = v2 Pod Pod ReplicaSet version = v1 type = FE #pods = 4 show: version = v2 version = v1 type = FE
  • 74. Google Cloud Platform Demo: Scaling @meteatamel
  • 75. Google Cloud Platform Rolling Update @meteatamel
  • 76. Google Cloud Platform ReplicaSet - name: my-app-v1 - replicas: 3 - selector: - app: MyApp - version: v1 Service - app: MyApp Rolling Update @meteatamel
  • 77. Google Cloud Platform ReplicaSet - name: my-app-v1 - replicas: 3 - selector: - app: MyApp - version: v1 ReplicaSet - name: my-app-v2 - replicas: 0 - selector: - app: MyApp - version: v2 Service - app: MyApp Rolling Update @meteatamel
  • 78. Google Cloud Platform ReplicaSet - name: my-app-v1 - replicas: 3 - selector: - app: MyApp - version: v1 ReplicaSet - name: my-app-v2 - replicas: 1 - selector: - app: MyApp - version: v2 Service - app: MyApp Rolling Update @meteatamel
  • 79. Google Cloud Platform ReplicaSet - name: my-app-v1 - replicas: 2 - selector: - app: MyApp - version: v1 ReplicaSet - name: my-app-v2 - replicas: 1 - selector: - app: MyApp - version: v2 Service - app: MyApp Rolling Update @meteatamel
  • 80. Google Cloud Platform ReplicaSet - name: my-app-v1 - replicas: 2 - selector: - app: MyApp - version: v1 ReplicaSet - name: my-app-v2 - replicas: 2 - selector: - app: MyApp - version: v2 Service - app: MyApp Rolling Update @meteatamel
  • 81. Google Cloud Platform ReplicaSet - name: my-app-v1 - replicas: 1 - selector: - app: MyApp - version: v1 ReplicaSet - name: my-app-v2 - replicas: 2 - selector: - app: MyApp - version: v2 Service - app: MyApp Rolling Update @meteatamel
  • 82. Google Cloud Platform ReplicaSet - name: my-app-v1 - replicas: 1 - selector: - app: MyApp - version: v1 ReplicaSet - name: my-app-v2 - replicas: 3 - selector: - app: MyApp - version: v2 Service - app: MyApp Rolling Update @meteatamel
  • 83. Google Cloud Platform ReplicaSet - name: my-app-v1 - replicas: 0 - selector: - app: MyApp - version: v1 ReplicaSet - name: my-app-v2 - replicas: 3 - selector: - app: MyApp - version: v2 Service - app: MyApp Rolling Update @meteatamel
  • 84. Google Cloud Platform ReplicaSet - name: my-app-v2 - replicas: 3 - selector: - app: MyApp - version: v2 Service - app: MyApp Rolling Update @meteatamel
  • 85. Google Cloud Platform Demo: Rolling Update @meteatamel
  • 86. Google Cloud Platform Canary Deployments Replication Controller ReplicaSet version = v2 type = BE #pods = 1 show: version = v2 Pod frontend Pod version = v2 type = BE @meteatamel Pod frontend Service Label selectors: version = 1.0 type = Frontend Service name = backend Label selector: type = BE Replication Controller Pod version= v1 ReplicaSet version = v1 type = BE #pods = 2 show: version = v2 type = BE type = BE Pod version = v1
  • 87. Google Cloud Platform Autoscaling Replication Controller Pod frontend Pod name=locust name=locust ReplicaSet name=locust role=worker #pods = 1 show: version = v2 Pod frontend Pod name=locust ReplicaSet name=locust role=worker #pods = 2 show: version = v2 Pod Pod name=locust role=worker role=worker role=worker role=worker ReplicaSet name=locust role=worker #pods = 4 Heapster 70% CPU 40% CPU Scale CPU Target% = 50 > 50% CPU @meteatamel
  • 89. Google Cloud Platform Problem: how to run a Pod on every node? • or a subset of nodes Similar to ReplicaSet • principle: do one thing, don’t overload “Which nodes?” is a selector Use familiar tools and patterns Pod DaemonSets @meteatamel
  • 91. Google Cloud Platform Run-to-completion, as opposed to run-forever • Express parallelism vs. required completions • Workflow: restart on failure • Build/test: don’t restart on failure Aggregates success/failure counts Built for batch and big-data work ... Jobs @meteatamel
  • 93. Google Cloud Platform Goal: enable clustered software on Kubernetes • mysql, redis, zookeeper, ... Clustered apps need “identity” and sequencing guarantees • stable hostname, available in DNS • an ordinal index • stable storage: linked to the ordinal & hostname • discovery of peers for quorum • startup/teardown ordering StatefulSets @meteatamel
  • 95. Google Cloud Platform Goal: manage app configuration • ...without making overly-brittle container images 12-factor says config comes from the environment • Kubernetes is the environment Manage config via the Kubernetes API Inject config as a virtual volume into your Pods • late-binding, live-updated (atomic) • also available as env vars node API Pod Config Map ConfigMaps @meteatamel
  • 97. Google Cloud Platform Goal: grant a pod access to a secured something • don’t put secrets in the container image! 12-factor says config comes from the environment • Kubernetes is the environment Manage secrets via the Kubernetes API Inject secrets as virtual volumes into your Pods • late-binding, tmpfs - never touches disk • also available as env vars node API Pod Secret Secrets @meteatamel
  • 98. Google Cloud Platform Deployment Pod Volume Label Selector Kubernetes Terminology ReplicaSet Liveness Probe Readiness Probe Service DaemonSet Job StatefulSet ConfigMap Secret
  • 99. Confidential & ProprietaryGoogle Cloud Platform 99 There is more! @meteatamel
  • 100. Confidential & ProprietaryGoogle Cloud Platform 100 kubernetes.io cloud.google.com/container-engine Mete Atamel @meteatamel [email protected] meteatamel.wordpress.com Thank You @meteatamel Send talk feedback bit.ly/atamel