SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
Container Scheduling
A Practical Guide
@tekgrrl #kubecon #kubernetes
@tekgrrl
+MandyWaite
@tekgrrl #kubecon #kubernetes
web browsers
BorgMaster
link shard
UI
shardBorgMaster
link shard
UI
shardBorgMaster
link shard
UI
shardBorgMaster
link shard
UI
shard
Scheduler
borgcfg web browsers
scheduler
Borglet Borglet Borglet Borglet
Config
file
BorgMaster
link shard
UI
shard
persistent store
(Paxos)
Binary
Cell
Storage
@tekgrrl #kubecon #kubernetes
Developer View
job hello_world = {
runtime = { cell = 'ic' } // Cell (cluster) to run in
binary = '.../hello_world_webserver' // Program to run
args = { port = '%port%' } // Command line parameters
requirements = { // Resource requirements
ram = 100M
disk = 100M
cpu = 0.1
}
replicas = 5 // Number of tasks
}
10000
@tekgrrl #kubecon #kubernetes
Developer View
@tekgrrl #kubecon #kubernetes
Hello
world!
Hello
world!
Hello
world!
Hello
world!Hello
world! Hello
world! Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world! Hello
world!
Hello
world!
Hello
world!
Hello
world!
Image by Connie
Zhou
Hello
world!
Hello
world!
Hello
world! Hello
world!
Hello
world! Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world! Hello
world!
Hello
world! Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world!
Hello
world! Hello
world!
Hello
world! Hello
world!
Hello
world!
Hello
world!
7
@tekgrrl #kubecon #kubernetes
Developer View
Hello world!
“Internally, we don't use VMs - we just use containers to
pack multiple tasks onto one machine, and stop them
treading on one another.” - John Wilkes
8
@tekgrrl #kubecon #kubernetes
Developer View
9
@tekgrrl #kubecon #kubernetes
task-eviction rates
and causes
Failures
10
@tekgrrl #kubecon #kubernetes
Images by
Connie Zhou
A 2000-machine service will have
>10 task exits per day
This is not a problem: it's normal
11
@tekgrrl #kubecon #kubernetes
available resources
one
machine
Efficiency
Advanced bin-
packing
algorithms
Experimental placement
of production VM
workload, July 2014
stranded resources
12
@tekgrrl #kubecon #kubernetes
Efficiency
UsedCPU
UsedCPU(incores)
UsedMemory
UsedMemory
Available
Resources
Stranded
Resources
UsedCPU(incores)UsedMemory
13
@tekgrrl #kubecon #kubernetes
tasks per machine
Efficiency
Multiple
applications
per machine
CPI^2 paper,
EuroSys 2013
Median
14
@tekgrrl #kubecon #kubernetes
web browsers
BorgMaster
link shard
UI
shardBorgMaster
link shard
UI
shardBorgMaster
link shard
UI
shardBorgMaster
link shard
UI
shard
Scheduler
borgcfg web browsers
scheduler
Cell
Config
file
BorgMaster
link shard
UI
shard
persistent store
(Paxos)
Binary
Cell
Storage
Efficiency
batch
Cells run both
Prod and Non
Prod tasks
batch
15
@tekgrrl #kubecon #kubernetes
Efficiency
Cell
Sharing Cells
between prod/non-
prod is Better
shared cell
(original)
shared cell
(compacted)
Cell
Non-Prod load
(compacted)
Prod load
(compacted)
Represents the
overhead of running
prod and non-prod in
their own cells
16
@tekgrrl #kubecon #kubernetes
Resource reclamation
time
limit: amount of resource
requested
usage: actual resource
consumption
Efficiency
reservation: estimate of
future usage
potentially reusable
resources
17
@tekgrrl #kubecon #kubernetes
Resource reclamation could be more aggressive
Nov/Dec 2013
Efficiency
18
@tekgrrl #kubecon #kubernetes
Nov/Dec 2013
Efficiency
Resource reclamation could be more aggressive
Kubernetes
@tekgrrl #kubecon #kubernetes
K8s Master
API Server
Dash Board
scheduler
Kubelet Kubelet Kubelet Kubelet
Container
Registry
etcdControllers
web browserskubectl web browsers
Config
file
Image
@tekgrrl #kubecon #kubernetes
Kubernetes without a Scheduler
K8s Master
API Server
Dash Board
scheduler etcd
apiVersion: v1
kind: Pod
metadata:
name: bursty-static
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
Controllers
k8s-minion-xyz
Kubelet
k8s-minion-abc
Kubelet
k8s-minion-fig
Kubelet
k8s-minion-cat
Kubelet
@tekgrrl #kubecon #kubernetes
Kubernetes without a Scheduler
K8s Master
API Server
Dashboard
k8s-minion-xyz
poddy
Kubelet
k8s-minion-abc
Kubelet
k8s-minion-fig
Kubelet
k8s-minion-cat
Kubelet
etcd
apiVersion: v1
kind: Pod
metadata:
name: poddy
spec:
nodeName: k8s-minion-xyz
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
Controllers
Resources
@tekgrrl #kubecon #kubernetes
A Resource is something that can be
requested, allocated, or consumed to/by
a pod or a container
CPU: Specified in units of Cores,
what that is depends on the provider
Memory: Specified in units of Bytes
CPU is Compressible (i.e. it has a rate
and can be throttled)
Memory is Incompressible, it can’t be
throttled
Kubernetes Resources
@tekgrrl #kubecon #kubernetes
Future Plans:
More Resources:
● Network Ops
● Network Bandwidth
● Storage
● IOPS
● Storage Time
Kubernetes Compute Unit (KCU)
Kubernetes Resources (contd)
@tekgrrl #kubecon #kubernetes
...
spec:
containers:
- name: locust
image: gcr.io/rabbit-skateboard/guestbook:gdg-rtv
resources:
requests:
memory: "300Mi"
cpu: "100m"
limits:
memory: "300Mi"
cpu: "100m"
my-controller.yaml
Resource based Scheduling
@tekgrrl #kubecon #kubernetes
Resource based Scheduling (Work In Progress)
Provide QoS for Scheduled Pods
Per Container CPU and Memory requirements
Specified as Request and Limit
Future releases will [better] support:
● Best Effort (Request == 0)
● Burstable ( Request < Limit)
● Guaranteed (Request == Limit)
Best Effort Scheduling for low priority workloads improves
Utilization at Google by 20%
@tekgrrl #kubecon #kubernetes
Scheduling Pods: Nodes
K8s Node
Kubelet
disk = ssd
Resources
LabelsDisks
Nodes may not be heterogeneous, they
can differ in important ways:
● CPU and Memory Resources
● Attached Disks
● Specific Hardware
Location may also be important
@tekgrrl #kubecon #kubernetes
What CPU and Memory Resources
does it need?
Can also be used as a measure of
priority
Pod Scheduling: Identifying Potential Nodes
K8s Node
Kubelet Proxy
CPU
Mem
@tekgrrl #kubecon #kubernetes
What Resources does it need?
What Disk(s) does it need (GCE PD and
EBS) and can it/they be mounted
without conflict?
Note: 1.1 limits to
Pod Scheduling: Finding Potential Nodes
K8s Node
Kubelet Proxy
CPU
Mem
@tekgrrl #kubecon #kubernetes
What Resources does it need?
What Disk(s) does it need?
What node(s) can it run on (Node
Selector)?
Pod Scheduling: Identifying Potential Nodes
K8s Node
Kubelet Proxy
CPU
Mem
disktype = ssd
kubectl label nodes node-3 disktype=ssd
(pod) spec:
nodeSelector:
disktype: ssd
@tekgrrl #kubecon #kubernetes
nodeAffinity (Alpha in 1.2)
{
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "beta.kubernetes.io/instance-type",
"operator": "In",
"values": ["n1-highmem-2", "n1-highmem-4"]
}
]
}
]
}
}
}
http://kubernetes.github.io/docs/user-guide/node-selection/
Implemented through Annotations in 1.2,
through fields in 1.3
Can be ‘Required’ or ‘Preferred’ during
scheduling
In future can can be ‘Required’ during
execution (Node labels can change)
Will eventually replace NodeSelector
If you specify both nodeSelector and
nodeAffinity, both must be satisfied
@tekgrrl #kubecon #kubernetes
Prefer node with most free resource
left after the pod is deployed
Prefer nodes with the specified label
Minimise number of Pods from the
same service on the same node
CPU and Memory is balanced after the
Pod is deployed [Default]
Pod Scheduling: Ranking Potential Nodes
Node2
Node3
Node1
@tekgrrl #kubecon #kubernetes
Extending the Scheduler
1. Add rules to the scheduler and
recompile
2. Run your own scheduler process
instead of, or as well as, the
Kubernetes scheduler
3. Implement a "scheduler extender"
that the Kubernetes scheduler calls
out to as a final pass when making
scheduling decisions
@tekgrrl #kubecon #kubernetes
Admission Control
Admission Control enforces certain conditions, before a
request is accepted by the API Server
AC functionality implemented as plugins which are
executed in the sequence they are specified
AC is performed after AuthN checks
Enforcement usually results in either
● A Request denial
● Mutation of the Request Resource
● Mutation of related Resources
K8s Master
API
Server
scheduler
Controllers
AdmissionControl
@tekgrrl #kubecon #kubernetes
NamespaceLifecycle
Enforces that a Namespace that is undergoing termination cannot have new objects created in it, and ensures that
requests in a non-existant Namespace are rejected
LimitRanger
Observes the incoming request and ensures that it does not violate any of the constraints enumerated in the
LimitRange object in a Namespace
ServiceAccount
Implements automation for serviceAccounts
ResourceQuota
Observes the incoming request and ensures that it does not violate any of the constraints enumerated in the
ResourceQuota object in a Namespace.
Default plug-ins in 1.2: --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,
ResourceQuota,PersistentVolumeLabel
Admission Control Examples
@tekgrrl #kubecon #kubernetes
Mandy’s Canonical K8s deck: http://bit.ly/1oRMS0r
One little-o R M S Zero little-r
Setting Pod and CPU Limits
Runtime Constraints Example
Extending the Scheduler
Resource Model Design Doc (beyond 1.1)
Resources
@tekgrrl #kubecon #kubernetes
Kubernetes is Open Source
We want your help!
http://kubernetes.io
https://github.com/kubernetes/kubernetes
Slack: #kubernetes-users
@kubernetesio
@tekgrrl #kubecon #kubernetes
Images by Connie
Zhou
cloud.google.com

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)Kubernetes - State of the Union (Q1-2016)
Kubernetes - State of the Union (Q1-2016)
 
Kubernetes Basic Operation
Kubernetes Basic OperationKubernetes Basic Operation
Kubernetes Basic Operation
 
Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
kubernetes for beginners
kubernetes for beginnerskubernetes for beginners
kubernetes for beginners
 
Kubernetes meetup 101
Kubernetes meetup 101Kubernetes meetup 101
Kubernetes meetup 101
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the Datacenter
 
KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
 
Kubernetes basics and hands on exercise
Kubernetes basics and hands on exerciseKubernetes basics and hands on exercise
Kubernetes basics and hands on exercise
 
Deep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingDeep dive into Kubernetes Networking
Deep dive into Kubernetes Networking
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes Networking - Giragadurai Vallirajan
Kubernetes Networking - Giragadurai VallirajanKubernetes Networking - Giragadurai Vallirajan
Kubernetes Networking - Giragadurai Vallirajan
 
Kubernetes persistence 101
Kubernetes persistence 101Kubernetes persistence 101
Kubernetes persistence 101
 
KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101KubeCon EU 2016: Kubernetes Storage 101
KubeCon EU 2016: Kubernetes Storage 101
 
Kubernetes intro public - kubernetes meetup 4-21-2015
Kubernetes intro   public - kubernetes meetup 4-21-2015Kubernetes intro   public - kubernetes meetup 4-21-2015
Kubernetes intro public - kubernetes meetup 4-21-2015
 
DevOps in AWS with Kubernetes
DevOps in AWS with KubernetesDevOps in AWS with Kubernetes
DevOps in AWS with Kubernetes
 
Kubernetes introduction
Kubernetes introductionKubernetes introduction
Kubernetes introduction
 
Net core, mssql, container und kubernetes
Net core, mssql, container und kubernetesNet core, mssql, container und kubernetes
Net core, mssql, container und kubernetes
 
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 

Andere mochten auch

Intro to Project Calico: a pure layer 3 approach to scale-out networking
Intro to Project Calico: a pure layer 3 approach to scale-out networkingIntro to Project Calico: a pure layer 3 approach to scale-out networking
Intro to Project Calico: a pure layer 3 approach to scale-out networking
Packet
 

Andere mochten auch (13)

KubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeCon EU 2016: Getting the Jobs Done With KubernetesKubeCon EU 2016: Getting the Jobs Done With Kubernetes
KubeCon EU 2016: Getting the Jobs Done With Kubernetes
 
KubeCon EU 2016:
KubeCon EU 2016: KubeCon EU 2016:
KubeCon EU 2016:
 
KubeCon EU 2016: Distributed containers in the physical world
KubeCon EU 2016: Distributed containers in the physical worldKubeCon EU 2016: Distributed containers in the physical world
KubeCon EU 2016: Distributed containers in the physical world
 
KubeCon EU 2016: Secure, Cloud-Native Networking with Project Calico
KubeCon EU 2016: Secure, Cloud-Native Networking with Project CalicoKubeCon EU 2016: Secure, Cloud-Native Networking with Project Calico
KubeCon EU 2016: Secure, Cloud-Native Networking with Project Calico
 
How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based Microservices
 
Using kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containersUsing kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containers
 
KubeCon EU 2016: ChatOps and Automatic Deployment on Kubernetes
KubeCon EU 2016: ChatOps and Automatic Deployment on KubernetesKubeCon EU 2016: ChatOps and Automatic Deployment on Kubernetes
KubeCon EU 2016: ChatOps and Automatic Deployment on Kubernetes
 
KubeCon EU 2016: Trading in the Kube
KubeCon EU 2016: Trading in the KubeKubeCon EU 2016: Trading in the Kube
KubeCon EU 2016: Trading in the Kube
 
KubeCon EU 2016: Integrated trusted computing in Kubernetes
KubeCon EU 2016: Integrated trusted computing in KubernetesKubeCon EU 2016: Integrated trusted computing in Kubernetes
KubeCon EU 2016: Integrated trusted computing in Kubernetes
 
Monitoring a Kubernetes-backed microservice architecture with Prometheus
Monitoring a Kubernetes-backed microservice architecture with PrometheusMonitoring a Kubernetes-backed microservice architecture with Prometheus
Monitoring a Kubernetes-backed microservice architecture with Prometheus
 
Intro to Project Calico: a pure layer 3 approach to scale-out networking
Intro to Project Calico: a pure layer 3 approach to scale-out networkingIntro to Project Calico: a pure layer 3 approach to scale-out networking
Intro to Project Calico: a pure layer 3 approach to scale-out networking
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architecture
 
Docker Networking with Project Calico
Docker Networking with Project CalicoDocker Networking with Project Calico
Docker Networking with Project Calico
 

Ähnlich wie KubeCon EU 2016: A Practical Guide to Container Scheduling

Running secured Spark job in Kubernetes compute cluster and integrating with ...
Running secured Spark job in Kubernetes compute cluster and integrating with ...Running secured Spark job in Kubernetes compute cluster and integrating with ...
Running secured Spark job in Kubernetes compute cluster and integrating with ...
DataWorks Summit
 

Ähnlich wie KubeCon EU 2016: A Practical Guide to Container Scheduling (20)

Kubernetes Problem-Solving
Kubernetes Problem-SolvingKubernetes Problem-Solving
Kubernetes Problem-Solving
 
Kubernetes Basis: Pods, Deployments, and Services
Kubernetes Basis: Pods, Deployments, and ServicesKubernetes Basis: Pods, Deployments, and Services
Kubernetes Basis: Pods, Deployments, and Services
 
Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of Containers
 
Metal-k8s presentation by Julien Girardin @ Paris Kubernetes Meetup
Metal-k8s presentation by Julien Girardin @ Paris Kubernetes MeetupMetal-k8s presentation by Julien Girardin @ Paris Kubernetes Meetup
Metal-k8s presentation by Julien Girardin @ Paris Kubernetes Meetup
 
[GS네오텍] Google Kubernetes Engine
[GS네오텍]  Google Kubernetes Engine [GS네오텍]  Google Kubernetes Engine
[GS네오텍] Google Kubernetes Engine
 
Kubernetes from the ground up
Kubernetes from the ground upKubernetes from the ground up
Kubernetes from the ground up
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
 
Kubernetes Administration from Zero to Hero.pdf
Kubernetes Administration from Zero to Hero.pdfKubernetes Administration from Zero to Hero.pdf
Kubernetes Administration from Zero to Hero.pdf
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Keynote #Tech - Google : aperçu de la gestion des services distribués chez Go...
Keynote #Tech - Google : aperçu de la gestion des services distribués chez Go...Keynote #Tech - Google : aperçu de la gestion des services distribués chez Go...
Keynote #Tech - Google : aperçu de la gestion des services distribués chez Go...
 
Running secured Spark job in Kubernetes compute cluster and integrating with ...
Running secured Spark job in Kubernetes compute cluster and integrating with ...Running secured Spark job in Kubernetes compute cluster and integrating with ...
Running secured Spark job in Kubernetes compute cluster and integrating with ...
 
A guide of PostgreSQL on Kubernetes
A guide of PostgreSQL on KubernetesA guide of PostgreSQL on Kubernetes
A guide of PostgreSQL on Kubernetes
 
Kubernetes Architecture with Components
 Kubernetes Architecture with Components Kubernetes Architecture with Components
Kubernetes Architecture with Components
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
KubeCon Prometheus Salon -- Kubernetes metrics deep dive
KubeCon Prometheus Salon -- Kubernetes metrics deep diveKubeCon Prometheus Salon -- Kubernetes metrics deep dive
KubeCon Prometheus Salon -- Kubernetes metrics deep dive
 
Federated Kubernetes: As a Platform for Distributed Scientific Computing
Federated Kubernetes: As a Platform for Distributed Scientific ComputingFederated Kubernetes: As a Platform for Distributed Scientific Computing
Federated Kubernetes: As a Platform for Distributed Scientific Computing
 
Kubernetes - Why It's Cool & Why It Maaters
Kubernetes - Why It's Cool & Why It MaatersKubernetes - Why It's Cool & Why It Maaters
Kubernetes - Why It's Cool & Why It Maaters
 
Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)
Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)
Day 2 Kubernetes - Tools for Operability (Velocity London Meetup)
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 

Mehr von KubeAcademy

KubeCon EU 2016: SmartCity IoT on Kubernetes
KubeCon EU 2016: SmartCity IoT on KubernetesKubeCon EU 2016: SmartCity IoT on Kubernetes
KubeCon EU 2016: SmartCity IoT on Kubernetes
KubeAcademy
 

Mehr von KubeAcademy (20)

KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipelineKubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
KubeCon EU 2016: Leveraging ephemeral namespaces in a CI/CD pipeline
 
KubeCon EU 2016: Heroku to Kubernetes
KubeCon EU 2016: Heroku to KubernetesKubeCon EU 2016: Heroku to Kubernetes
KubeCon EU 2016: Heroku to Kubernetes
 
KubeCon EU 2016: Transforming the Government
KubeCon EU 2016: Transforming the Government KubeCon EU 2016: Transforming the Government
KubeCon EU 2016: Transforming the Government
 
KubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
KubeCon EU 2016: Using Traffic Control to Test Apps in KubernetesKubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
KubeCon EU 2016: Using Traffic Control to Test Apps in Kubernetes
 
KubeCon EU 2016: Kubernetes in Production in The New York Times newsroom
KubeCon EU 2016: Kubernetes in Production in The New York Times newsroomKubeCon EU 2016: Kubernetes in Production in The New York Times newsroom
KubeCon EU 2016: Kubernetes in Production in The New York Times newsroom
 
KubeCon EU 2016: ITNW (If This Now What): Orchestrating an Enterprise
KubeCon EU 2016: ITNW (If This Now What): Orchestrating an EnterpriseKubeCon EU 2016: ITNW (If This Now What): Orchestrating an Enterprise
KubeCon EU 2016: ITNW (If This Now What): Orchestrating an Enterprise
 
KubeCon EU 2016: SmartCity IoT on Kubernetes
KubeCon EU 2016: SmartCity IoT on KubernetesKubeCon EU 2016: SmartCity IoT on Kubernetes
KubeCon EU 2016: SmartCity IoT on Kubernetes
 
KubeCon EU 2016 Keynote: Pushing Kubernetes Forward
KubeCon EU 2016 Keynote: Pushing Kubernetes ForwardKubeCon EU 2016 Keynote: Pushing Kubernetes Forward
KubeCon EU 2016 Keynote: Pushing Kubernetes Forward
 
KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...
KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...
KubeCon EU 2016: Creating an Advanced Load Balancing Solution for Kubernetes ...
 
KubeCon EU 2016: Killing containers to make weather beautiful
KubeCon EU 2016: Killing containers to make weather beautifulKubeCon EU 2016: Killing containers to make weather beautiful
KubeCon EU 2016: Killing containers to make weather beautiful
 
KubeCon EU 2016: Bringing an open source Containerized Container Platform to ...
KubeCon EU 2016: Bringing an open source Containerized Container Platform to ...KubeCon EU 2016: Bringing an open source Containerized Container Platform to ...
KubeCon EU 2016: Bringing an open source Containerized Container Platform to ...
 
KubeCon EU 2016: "rktnetes": what's new with container runtimes and Kubernetes
KubeCon EU 2016: "rktnetes": what's new with container runtimes and KubernetesKubeCon EU 2016: "rktnetes": what's new with container runtimes and Kubernetes
KubeCon EU 2016: "rktnetes": what's new with container runtimes and Kubernetes
 
KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with KubernetesKubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
KubeCon EU 2016: Full Automatic Database: PostgreSQL HA with Kubernetes
 
KubeCon EU 2016: A lightweight deployment system for appops
KubeCon EU 2016: A lightweight deployment system for appopsKubeCon EU 2016: A lightweight deployment system for appops
KubeCon EU 2016: A lightweight deployment system for appops
 
KubeCon EU 2016: Scaling Open edX with Kubernetes
KubeCon EU 2016: Scaling Open edX with KubernetesKubeCon EU 2016: Scaling Open edX with Kubernetes
KubeCon EU 2016: Scaling Open edX with Kubernetes
 
KubeCon EU 2016: Custom Volume Plugins
KubeCon EU 2016: Custom Volume PluginsKubeCon EU 2016: Custom Volume Plugins
KubeCon EU 2016: Custom Volume Plugins
 
KubeCon EU 2016: What is OpenStack's role in a Kubernetes world?
KubeCon EU 2016: What is OpenStack's role in a Kubernetes world?KubeCon EU 2016: What is OpenStack's role in a Kubernetes world?
KubeCon EU 2016: What is OpenStack's role in a Kubernetes world?
 
KubeCon EU 2016: Kubernetes and the Potential for Higher Level Interfaces
KubeCon EU 2016: Kubernetes and the Potential for Higher Level InterfacesKubeCon EU 2016: Kubernetes and the Potential for Higher Level Interfaces
KubeCon EU 2016: Kubernetes and the Potential for Higher Level Interfaces
 
KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices
KubeCon EU 2016: Kubernetes meets Finagle for Resilient MicroservicesKubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices
KubeCon EU 2016: Kubernetes meets Finagle for Resilient Microservices
 
KubeCon EU 2016 Keynote: Kubernetes State of the Union
KubeCon EU 2016 Keynote: Kubernetes State of the UnionKubeCon EU 2016 Keynote: Kubernetes State of the Union
KubeCon EU 2016 Keynote: Kubernetes State of the Union
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Kürzlich hochgeladen (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

KubeCon EU 2016: A Practical Guide to Container Scheduling

  • 3. @tekgrrl #kubecon #kubernetes web browsers BorgMaster link shard UI shardBorgMaster link shard UI shardBorgMaster link shard UI shardBorgMaster link shard UI shard Scheduler borgcfg web browsers scheduler Borglet Borglet Borglet Borglet Config file BorgMaster link shard UI shard persistent store (Paxos) Binary Cell Storage
  • 4. @tekgrrl #kubecon #kubernetes Developer View job hello_world = { runtime = { cell = 'ic' } // Cell (cluster) to run in binary = '.../hello_world_webserver' // Program to run args = { port = '%port%' } // Command line parameters requirements = { // Resource requirements ram = 100M disk = 100M cpu = 0.1 } replicas = 5 // Number of tasks } 10000
  • 6. @tekgrrl #kubecon #kubernetes Hello world! Hello world! Hello world! Hello world!Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Image by Connie Zhou Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!
  • 7. 7 @tekgrrl #kubecon #kubernetes Developer View Hello world! “Internally, we don't use VMs - we just use containers to pack multiple tasks onto one machine, and stop them treading on one another.” - John Wilkes
  • 10. 10 @tekgrrl #kubecon #kubernetes Images by Connie Zhou A 2000-machine service will have >10 task exits per day This is not a problem: it's normal
  • 11. 11 @tekgrrl #kubecon #kubernetes available resources one machine Efficiency Advanced bin- packing algorithms Experimental placement of production VM workload, July 2014 stranded resources
  • 13. 13 @tekgrrl #kubecon #kubernetes tasks per machine Efficiency Multiple applications per machine CPI^2 paper, EuroSys 2013 Median
  • 14. 14 @tekgrrl #kubecon #kubernetes web browsers BorgMaster link shard UI shardBorgMaster link shard UI shardBorgMaster link shard UI shardBorgMaster link shard UI shard Scheduler borgcfg web browsers scheduler Cell Config file BorgMaster link shard UI shard persistent store (Paxos) Binary Cell Storage Efficiency batch Cells run both Prod and Non Prod tasks batch
  • 15. 15 @tekgrrl #kubecon #kubernetes Efficiency Cell Sharing Cells between prod/non- prod is Better shared cell (original) shared cell (compacted) Cell Non-Prod load (compacted) Prod load (compacted) Represents the overhead of running prod and non-prod in their own cells
  • 16. 16 @tekgrrl #kubecon #kubernetes Resource reclamation time limit: amount of resource requested usage: actual resource consumption Efficiency reservation: estimate of future usage potentially reusable resources
  • 17. 17 @tekgrrl #kubecon #kubernetes Resource reclamation could be more aggressive Nov/Dec 2013 Efficiency
  • 18. 18 @tekgrrl #kubecon #kubernetes Nov/Dec 2013 Efficiency Resource reclamation could be more aggressive
  • 20. @tekgrrl #kubecon #kubernetes K8s Master API Server Dash Board scheduler Kubelet Kubelet Kubelet Kubelet Container Registry etcdControllers web browserskubectl web browsers Config file Image
  • 21. @tekgrrl #kubecon #kubernetes Kubernetes without a Scheduler K8s Master API Server Dash Board scheduler etcd apiVersion: v1 kind: Pod metadata: name: bursty-static spec: containers: - name: nginx image: nginx ports: - containerPort: 80 Controllers k8s-minion-xyz Kubelet k8s-minion-abc Kubelet k8s-minion-fig Kubelet k8s-minion-cat Kubelet
  • 22. @tekgrrl #kubecon #kubernetes Kubernetes without a Scheduler K8s Master API Server Dashboard k8s-minion-xyz poddy Kubelet k8s-minion-abc Kubelet k8s-minion-fig Kubelet k8s-minion-cat Kubelet etcd apiVersion: v1 kind: Pod metadata: name: poddy spec: nodeName: k8s-minion-xyz containers: - name: nginx image: nginx ports: - containerPort: 80 Controllers
  • 24. @tekgrrl #kubecon #kubernetes A Resource is something that can be requested, allocated, or consumed to/by a pod or a container CPU: Specified in units of Cores, what that is depends on the provider Memory: Specified in units of Bytes CPU is Compressible (i.e. it has a rate and can be throttled) Memory is Incompressible, it can’t be throttled Kubernetes Resources
  • 25. @tekgrrl #kubecon #kubernetes Future Plans: More Resources: ● Network Ops ● Network Bandwidth ● Storage ● IOPS ● Storage Time Kubernetes Compute Unit (KCU) Kubernetes Resources (contd)
  • 26. @tekgrrl #kubecon #kubernetes ... spec: containers: - name: locust image: gcr.io/rabbit-skateboard/guestbook:gdg-rtv resources: requests: memory: "300Mi" cpu: "100m" limits: memory: "300Mi" cpu: "100m" my-controller.yaml Resource based Scheduling
  • 27. @tekgrrl #kubecon #kubernetes Resource based Scheduling (Work In Progress) Provide QoS for Scheduled Pods Per Container CPU and Memory requirements Specified as Request and Limit Future releases will [better] support: ● Best Effort (Request == 0) ● Burstable ( Request < Limit) ● Guaranteed (Request == Limit) Best Effort Scheduling for low priority workloads improves Utilization at Google by 20%
  • 28. @tekgrrl #kubecon #kubernetes Scheduling Pods: Nodes K8s Node Kubelet disk = ssd Resources LabelsDisks Nodes may not be heterogeneous, they can differ in important ways: ● CPU and Memory Resources ● Attached Disks ● Specific Hardware Location may also be important
  • 29. @tekgrrl #kubecon #kubernetes What CPU and Memory Resources does it need? Can also be used as a measure of priority Pod Scheduling: Identifying Potential Nodes K8s Node Kubelet Proxy CPU Mem
  • 30. @tekgrrl #kubecon #kubernetes What Resources does it need? What Disk(s) does it need (GCE PD and EBS) and can it/they be mounted without conflict? Note: 1.1 limits to Pod Scheduling: Finding Potential Nodes K8s Node Kubelet Proxy CPU Mem
  • 31. @tekgrrl #kubecon #kubernetes What Resources does it need? What Disk(s) does it need? What node(s) can it run on (Node Selector)? Pod Scheduling: Identifying Potential Nodes K8s Node Kubelet Proxy CPU Mem disktype = ssd kubectl label nodes node-3 disktype=ssd (pod) spec: nodeSelector: disktype: ssd
  • 32. @tekgrrl #kubecon #kubernetes nodeAffinity (Alpha in 1.2) { "nodeAffinity": { "requiredDuringSchedulingIgnoredDuringExecution": { "nodeSelectorTerms": [ { "matchExpressions": [ { "key": "beta.kubernetes.io/instance-type", "operator": "In", "values": ["n1-highmem-2", "n1-highmem-4"] } ] } ] } } } http://kubernetes.github.io/docs/user-guide/node-selection/ Implemented through Annotations in 1.2, through fields in 1.3 Can be ‘Required’ or ‘Preferred’ during scheduling In future can can be ‘Required’ during execution (Node labels can change) Will eventually replace NodeSelector If you specify both nodeSelector and nodeAffinity, both must be satisfied
  • 33. @tekgrrl #kubecon #kubernetes Prefer node with most free resource left after the pod is deployed Prefer nodes with the specified label Minimise number of Pods from the same service on the same node CPU and Memory is balanced after the Pod is deployed [Default] Pod Scheduling: Ranking Potential Nodes Node2 Node3 Node1
  • 34. @tekgrrl #kubecon #kubernetes Extending the Scheduler 1. Add rules to the scheduler and recompile 2. Run your own scheduler process instead of, or as well as, the Kubernetes scheduler 3. Implement a "scheduler extender" that the Kubernetes scheduler calls out to as a final pass when making scheduling decisions
  • 35. @tekgrrl #kubecon #kubernetes Admission Control Admission Control enforces certain conditions, before a request is accepted by the API Server AC functionality implemented as plugins which are executed in the sequence they are specified AC is performed after AuthN checks Enforcement usually results in either ● A Request denial ● Mutation of the Request Resource ● Mutation of related Resources K8s Master API Server scheduler Controllers AdmissionControl
  • 36. @tekgrrl #kubecon #kubernetes NamespaceLifecycle Enforces that a Namespace that is undergoing termination cannot have new objects created in it, and ensures that requests in a non-existant Namespace are rejected LimitRanger Observes the incoming request and ensures that it does not violate any of the constraints enumerated in the LimitRange object in a Namespace ServiceAccount Implements automation for serviceAccounts ResourceQuota Observes the incoming request and ensures that it does not violate any of the constraints enumerated in the ResourceQuota object in a Namespace. Default plug-ins in 1.2: --admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount, ResourceQuota,PersistentVolumeLabel Admission Control Examples
  • 37. @tekgrrl #kubecon #kubernetes Mandy’s Canonical K8s deck: http://bit.ly/1oRMS0r One little-o R M S Zero little-r Setting Pod and CPU Limits Runtime Constraints Example Extending the Scheduler Resource Model Design Doc (beyond 1.1) Resources
  • 38. @tekgrrl #kubecon #kubernetes Kubernetes is Open Source We want your help! http://kubernetes.io https://github.com/kubernetes/kubernetes Slack: #kubernetes-users @kubernetesio
  • 39. @tekgrrl #kubecon #kubernetes Images by Connie Zhou cloud.google.com