SlideShare a Scribd company logo
1 of 77
Download to read offline
Containerised ASP.NET Core apps 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
Agenda
The .NET Revolution
Convergence of the two worlds with .NET Core
Containers
What are containers? How do they help?
Kubernetes
What is Kubernetes? How does it help with management of containers?
Kubernetes building blocks
Deployments, pods, labels, selectors, services, replica sets and more
@meteatamel
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 8
Great time to be a .NET developer!
Google Cloud Platform
ASP.NET Deployment options on Google Cloud @meteatamel
Compute Engine App Engine
flexible environment
Kubernetes on
Container
Engine
ASP.NET on Windows ASP.NET Core on Linux
Google Cloud Platform
Demo: Simple ASP.NET Core service
@meteatamel
Google Cloud Platform
Containers
@meteatamel
Google Cloud Platform
What is a container?
Lightweight
Hermetically sealed
Isolated
Easily deployable
Introspectable
Composable
Linux (or Windows) processes
Docker
A lightweight way to virtualize applications
@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
Shared Machines VMs/Bare Metal Containers
@meteatamel
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
But you still need to manage your app in production
● Resiliency
● Scaling up and down
● Deploying a new version of your app reliably
● Rolling back a version
● Health checks
● Graceful shutdown
● Etc.
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
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
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
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
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
Replication
@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: Replication
@meteatamel
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
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
Confidential & ProprietaryGoogle Cloud Platform 76
There is more!
@meteatamel
Confidential & ProprietaryGoogle Cloud Platform 77
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

What's hot (20)

Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance test
 
Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0Monitoring Akka with Kamon 1.0
Monitoring Akka with Kamon 1.0
 
Testing the Enterprise layers, with Arquillian
Testing the Enterprise layers, with ArquillianTesting the Enterprise layers, with Arquillian
Testing the Enterprise layers, with Arquillian
 
Jenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipelineJenkins vs. AWS CodePipeline
Jenkins vs. AWS CodePipeline
 
Workflow automation for Front-end web applications
Workflow automation for Front-end web applicationsWorkflow automation for Front-end web applications
Workflow automation for Front-end web applications
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Learn jobDSL for Jenkins
Learn jobDSL for JenkinsLearn jobDSL for Jenkins
Learn jobDSL for Jenkins
 
Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017
 
Setting Up Development Environment For Google App Engine & Python | Talentica
Setting Up Development Environment For Google App Engine & Python | TalenticaSetting Up Development Environment For Google App Engine & Python | Talentica
Setting Up Development Environment For Google App Engine & Python | Talentica
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"
 
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
"Technical Challenges behind Visual IDE for React Components" Tetiana Mandziuk
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
 
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
stackconf 2020 | Enterprise CI/CD Integration Testing Environments Done Right...
 
Building and Deployment of Drupal sites with Features and Context
Building and Deployment of Drupal sites with Features and ContextBuilding and Deployment of Drupal sites with Features and Context
Building and Deployment of Drupal sites with Features and Context
 
Unleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudUnleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket Cloud
 
Евгений Жарков "React Native: Hurdle Race"
Евгений Жарков "React Native: Hurdle Race"Евгений Жарков "React Native: Hurdle Race"
Евгений Жарков "React Native: Hurdle Race"
 
What's new with Apache Camel 3? | DevNation Tech Talk
What's new with Apache Camel 3? | DevNation Tech TalkWhat's new with Apache Camel 3? | DevNation Tech Talk
What's new with Apache Camel 3? | DevNation Tech Talk
 

Similar to Mete Atamel

Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on KubernetesRiga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Claus Ibsen
 

Similar to Mete Atamel (20)

Containerised ASP.NET Core apps with Kubernetes
Containerised ASP.NET Core apps with KubernetesContainerised ASP.NET Core apps with Kubernetes
Containerised ASP.NET Core apps with Kubernetes
 
Resilient microservices with Kubernetes - Mete Atamel
Resilient microservices with Kubernetes - Mete AtamelResilient microservices with Kubernetes - Mete Atamel
Resilient microservices with Kubernetes - Mete Atamel
 
Mete Atamel "Resilient microservices with kubernetes"
Mete Atamel "Resilient microservices with kubernetes"Mete Atamel "Resilient microservices with kubernetes"
Mete Atamel "Resilient microservices with kubernetes"
 
Resilient microservices with Kubernetes - Mete Atamel - Codemotion Rome 2017
Resilient microservices with Kubernetes - Mete Atamel - Codemotion Rome 2017Resilient microservices with Kubernetes - Mete Atamel - Codemotion Rome 2017
Resilient microservices with Kubernetes - Mete Atamel - Codemotion Rome 2017
 
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with Kubernetes
 
Monitoring kubernetes across data center and cloud
Monitoring kubernetes across data center and cloudMonitoring kubernetes across data center and cloud
Monitoring kubernetes across data center and cloud
 
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB201904_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
04_Azure Kubernetes Service: Basic Practices for Developers_GAB2019
 
Net core, mssql, container und kubernetes
Net core, mssql, container und kubernetesNet core, mssql, container und kubernetes
Net core, mssql, container und kubernetes
 
Webinar- Tea for the Tillerman
Webinar- Tea for the TillermanWebinar- Tea for the Tillerman
Webinar- Tea for the Tillerman
 
Kubernetes for Java Developers
Kubernetes for Java DevelopersKubernetes for Java Developers
Kubernetes for Java Developers
 
Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6
 
Openstack days sv building highly available services using kubernetes (preso)
Openstack days sv   building highly available services using kubernetes (preso)Openstack days sv   building highly available services using kubernetes (preso)
Openstack days sv building highly available services using kubernetes (preso)
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018
 
London Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story
London Adapt or Die: Kubernetes, Containers and Cloud - The MoD StoryLondon Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story
London Adapt or Die: Kubernetes, Containers and Cloud - The MoD Story
 
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on KubernetesRiga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
Riga Dev Day 2016 - Microservices with Apache Camel & fabric8 on Kubernetes
 
Cluster api devopscon berlin
Cluster api devopscon berlinCluster api devopscon berlin
Cluster api devopscon berlin
 
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
 
Kubernetes 101 Workshop
Kubernetes 101 WorkshopKubernetes 101 Workshop
Kubernetes 101 Workshop
 

More from CodeFest

More from CodeFest (20)

Alexander Graebe
Alexander GraebeAlexander Graebe
Alexander Graebe
 
Никита Прокопов
Никита ПрокоповНикита Прокопов
Никита Прокопов
 
Денис Баталов
Денис БаталовДенис Баталов
Денис Баталов
 
Елена Гальцина
Елена ГальцинаЕлена Гальцина
Елена Гальцина
 
Александр Калашников
Александр КалашниковАлександр Калашников
Александр Калашников
 
Ирина Иванова
Ирина ИвановаИрина Иванова
Ирина Иванова
 
Marko Berković
Marko BerkovićMarko Berković
Marko Berković
 
Денис Кортунов
Денис КортуновДенис Кортунов
Денис Кортунов
 
Александр Зимин
Александр ЗиминАлександр Зимин
Александр Зимин
 
Сергей Крапивенский
Сергей КрапивенскийСергей Крапивенский
Сергей Крапивенский
 
Сергей Игнатов
Сергей ИгнатовСергей Игнатов
Сергей Игнатов
 
Николай Крапивный
Николай КрапивныйНиколай Крапивный
Николай Крапивный
 
Alexander Graebe
Alexander GraebeAlexander Graebe
Alexander Graebe
 
Вадим Смирнов
Вадим СмирновВадим Смирнов
Вадим Смирнов
 
Константин Осипов
Константин ОсиповКонстантин Осипов
Константин Осипов
 
Максим Пугачев
Максим ПугачевМаксим Пугачев
Максим Пугачев
 
Иван Бондаренко
Иван БондаренкоИван Бондаренко
Иван Бондаренко
 
Алексей Акулович
Алексей АкуловичАлексей Акулович
Алексей Акулович
 
Артем Титаренко
Артем ТитаренкоАртем Титаренко
Артем Титаренко
 
Олег Савкин
Олег СавкинОлег Савкин
Олег Савкин
 

Recently uploaded

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 

Mete Atamel

  • 1. Containerised ASP.NET Core apps with Kubernetes Mete Atamel Developer Advocate for Google Cloud ` @meteatamel
  • 2. 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
  • 3. Google Cloud Platform Agenda The .NET Revolution Convergence of the two worlds with .NET Core Containers What are containers? How do they help? Kubernetes What is Kubernetes? How does it help with management of containers? Kubernetes building blocks Deployments, pods, labels, selectors, services, replica sets and more @meteatamel
  • 4. Google Cloud Platform The .NET Revolution @meteatamel
  • 5. Google Cloud Platform The world of 2014 ASP.NET C# Visual Studio SQL Server PowerShell Java Apache MySQL Eclipse Bash @meteatamel
  • 6. 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
  • 7. Google Cloud Platform The convergence ASP.NET C# Visual Studio SQL Server Java ApacheMySQL PowerShell Eclipse Bash
  • 8. Confidential & ProprietaryGoogle Cloud Platform 8 Great time to be a .NET developer!
  • 9. Google Cloud Platform ASP.NET Deployment options on Google Cloud @meteatamel Compute Engine App Engine flexible environment Kubernetes on Container Engine ASP.NET on Windows ASP.NET Core on Linux
  • 10. Google Cloud Platform Demo: Simple ASP.NET Core service @meteatamel
  • 12. Google Cloud Platform What is a container? Lightweight Hermetically sealed Isolated Easily deployable Introspectable Composable Linux (or Windows) processes Docker A lightweight way to virtualize applications @meteatamel
  • 13. 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 Shared Machines VMs/Bare Metal Containers @meteatamel
  • 14. Google Cloud Platform Google has been developing and using containers to manage our applications for over 12 years. Images by Connie Zhou @meteatamel
  • 15. 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
  • 16. Google Cloud Platform Demo: Containerised Microservice @meteatamel
  • 17. Google Cloud Platform Containers not enough @meteatamel Containers help to create a lightweight and consistent environment for apps But you still need to manage your app in production ● Resiliency ● Scaling up and down ● Deploying a new version of your app reliably ● Rolling back a version ● Health checks ● Graceful shutdown ● Etc.
  • 19. 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
  • 20. Google Cloud Platform kubelet UI kubeletCLI API users master nodes etcd kubelet scheduler controllers apiserver The 10000 foot view @meteatamel
  • 21. Google Cloud Platform UI API Container Cluster All you really care about @meteatamel
  • 22. 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
  • 23. Google Cloud Platform Kubernetes cluster on GKE @meteatamel
  • 24. Google Cloud Platform Demo: Create Kubernetes cluster @meteatamel
  • 25. 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
  • 26. Google Cloud Platform Kubernetes Building Blocks @meteatamel
  • 27. 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
  • 29. 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
  • 30. Google Cloud Platform Demo: Create Deployment @meteatamel
  • 31. Google Cloud Platform Pods and Volumes @meteatamel
  • 32. 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
  • 33. 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
  • 34. Google Cloud Platform Labels & Selectors @meteatamel
  • 35. 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
  • 36. 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
  • 37. 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
  • 38. 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
  • 39. 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
  • 40. 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
  • 41. 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
  • 43. 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
  • 44. 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
  • 45. Google Cloud Platform Demo: Replication @meteatamel
  • 47. 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
  • 48. Google Cloud Platform Demo: Services @meteatamel
  • 50. 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
  • 51. 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
  • 52. Google Cloud Platform Demo: Scaling @meteatamel
  • 53. Google Cloud Platform Rolling Update @meteatamel
  • 54. Google Cloud Platform ReplicaSet - name: my-app-v1 - replicas: 3 - selector: - app: MyApp - version: v1 Service - app: MyApp Rolling Update @meteatamel
  • 55. 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
  • 56. 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
  • 57. 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
  • 58. 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
  • 59. 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
  • 60. 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
  • 61. 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
  • 62. Google Cloud Platform ReplicaSet - name: my-app-v2 - replicas: 3 - selector: - app: MyApp - version: v2 Service - app: MyApp Rolling Update @meteatamel
  • 63. Google Cloud Platform Demo: Rolling Update @meteatamel
  • 64. 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
  • 65. 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
  • 67. 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
  • 69. 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
  • 71. 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
  • 73. 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
  • 75. 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
  • 76. Confidential & ProprietaryGoogle Cloud Platform 76 There is more! @meteatamel
  • 77. Confidential & ProprietaryGoogle Cloud Platform 77 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