CTO @ DynoMarketing
Technologies: Java, Python, all kind of databases and
Cloud platform from Google, Aws, Azure.
Interests: Cloud computing / architecture, technology
evolution, distributed systems.
Husband, Father, GDE, Open source contributor.
Tu Pham
foto: Lars Kruse, Aarhus Universitet
Pervasive Systems group, Section of Electrical and Computer Engineering, Department of Engineering, Aarhus University
2
resilience
or resiliency
[ri-zil-yuh ns, -zil-ee-uh ns]
noun
2.
1. the power or ability to return to the original form, position, etc., after being bent,
compressed, or stretched: elasticity.
ability to recover readily from illness, depression, adversity, or the like; buoyancy
Source: http://www.dictionary.com/browse/resilience
14
T h e f a l l a c i e s o f d i s t r i b u t e d c o m p u t i n g
1. T h e n e t w o r k is r e l i a b l e
2. L a t e n c y is ze r o
3. B a n d w i d t h is i n f i n i t e
4. T h e n e t w o r k is s e c u re
5. To p o l o g y doesn’t c h a n g e
6. T h e re is o n e a d m i n i s t r a t o r
7. Tra n s p o r t c o s t is ze r o
8. T h e n e t w o r k is h o m o g e n e o u s
17
- Application level
-
-
-
-
-
Synchronous/Asynchronous architecture (request/response, message queues)
Apply circuit breakers at integrationpoints
Manage timeouts
Bulkheads
Health checks
- Infrastructure level
-
-
Fault tolerance
Infrastructure that detectsfailures
What can wedo?
18
Google Container Engine
Fully Managed
Container Engine is fully managed by Google reliability
engineers, ensuring your cluster is available and up-to-
date.
Private ContainerRegistry
Google Container Registry makes it easy to store and
access your private Dockerimages.
Scalable
Easily adjust the cluster resources allocated to your
containers, or the size of your container cluster, as
your application's requirements change.
Docker Support
Container Engine supports the commonDocker
container format.
Logging
Enable Google Cloud Logging with a singlecheckbox,
making it easy to gain insight into how your
application is running
Hybrid Networking
Reserve an IP address range for your container cluster,
allowing your cluster IPs to coexist with private
network IPs via Google CloudVPN.
Source: https://cloud.google.com/container-engine/34
Google Container Registry
Container Engine
Use container images with Container Engine with no
authentication setup.
Advanced Authentication
Easily integrate with your favorite continuous
integration, continuous delivery, and container
orchestration systems withnative Docker Login
support.
Container Tags
Add and remove image tags with a simple click in the
web UI.
Docker V2 Registry API Support
Push and pull Docker images to your private Container
Registry using the V2API.
Docker CLIIntegration
Pull container images from Container Registry using
the standard Docker command lineinterface.
Regional Repositories
Get the fastest possible pull times by storing your
images close to your Compute Engine instances in
Europe,Asia, or USregional Cloud Storagebuckets.
Search Images
Quickly search for images by name and tag.
Nearline StorageIntegration
Archival storage of images in Cloud Storage Nearline
buckets.
Source: https://cloud.google.com/container-registry/35
Kubernetes - Infrastructure For EveryoneElse
Kubernetes is an open-source system for automating deployment, operations,
and scaling of containerizedapplications.
#GIFEE
36
“Containerization transforms the datacenter
from being machine-oriented to being
application-oriented”
Burns et al., Borg, Omega, and Kubernetes, 2016
Source: research.google.com/pubs/pub44843.html43
-
-
-
-
-
-
Greek for “pilot” or “helmsman of a ship”
Runs and manages containers
Builds on Googles experiences running a hyper-scale webplatform for more than 15 years.
Inspired by Googles internal Cluster Management and scheduling platform, “Borg”
Supports multiple cloud and bare-metalenvironments
100% Open source, written inGo
What is Kubernetes?
Source: https://youtu.be/_xNFt7FsWaA 44
Everything at Google runs incontainers
-
-
-
-
Gmail, Web search, …
MapReduce, batch, …
GFS,Colossus, …
Even Google’s Cloud Platform:
VMs run in containers
In fact, launches over 2 billion containers perweek.
Google and Containers
47
Pods
- Kubernetes uses nested containers
-
-
The outer-most one provides a pool of resources, and is called a pod
The inner ones provide deployment isolation
- Kubernetes regularizes things and always run an application container inside a top-level
pod, even if the pod contains a single container
-
-
-
“Apod is a collection of containers that are tightly bound”, Brian Dorsey
The atom of scheduling for containers
Runs on the same virtual/physicalhost
51
Pod networking
-
-
Pods have IPs which areroutable
Pods can communicate directly with each other
- Even across nodes
-
-
No brokering of PortNumbers
Many solutions
- Contiv
- Flannel
- Google Compute Engine
- L2 Networks and linux briding
- Nuage network VCS
- OpenVSwitch
- …
54
Services
-
-
-
Aservice has a static IP and aDNS entry
Acts as a load-balancer and knows how to route traffic to pods
Load balances incoming request across constituent pods
57
Labels
-
-
-
-
Labels are simple key/valuepairs
Kubernetes connects things together withlabels
Only grouping mechanism in Kubernetes
Reduces coupling
Web server
track=staging
app=webserver
tier=frontend
Container
Pod
60
ReplicaSets
-
-
A Replica Set ensures that a specified number of pods “replicas” are running at any given
time.
Replica Set is the next-generation ReplicationController
- The only difference right now is the selector support (set-based support)
- Use deployments tocontrol your Replica Sets
62
Deployments
-
-
-
Deployment is a higher-level concept that manages replica sets, pods and provides
declarative updates to pods along with a lot of other useful features
You only need to describe the desired state in a Deployment object, and the Deployment
controller will change the actual state to the desired state at a controlled rate for you
Deploying a new version will result in a rolling-update, where Kubernetes will replace one
pod at a time until all are running the latest version.
65
Scale (auto)
-
-
-
-
Horizontal Pod Autoscaler allows you to automatically scale the number of pods in a
deployment based on observed CPUutilization.
The autoscaler is implemented as a Kubernetes API resource and controller.
The resource describes behavior of thecontroller
The controller periodically adjusts the number of replicas in a deployment to match the
observed average CPU utilization to the target specified by the user.
74
Scale (auto)
Pod 1
Container
type=FE
Pod 2
Container
type=FE
Pod N
Container
type=FE
version=3 version=3 version=3
Deployment
Scale
…
Horizontal
Pod
Autoscaler
kubectl autoscale deployment foo --max=5 --cpu-percent=80
75
Kubernetes One Million Requests Per Second Demo
config-service
https://github.com/kubernetes/contrib
80
References
-
-
Book: “The Cloud computing bible”, Sosinsky,B.
Link: “Microservices - a definition of this new architectural term”, Fowler, M., Lewis, J.
- martinfowler.com/articles/microservices.html
- Link: “Borg, Omega, and Kubernetes”, Burns, B. et al.
- http://research.google.com/pubs/pub44843.html
- Link: “Introduction to Docker”
- http://pointful.github.io/docker-intro/
81