google cloud platform and kubernetes
TRANSCRIPT
![Page 1: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/1.jpg)
Cloud Platform and KubernetesGoogle Developer Group Aarhus Meet-up Thursday, 28th April 2016
Martin Jensen & Kasper Nissen
www.rpi-cloud.com
@mrjensens @phennex
![Page 2: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/2.jpg)
Views and opinions are our own. We do not work for, nor do we speak on behalf of .
![Page 3: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/3.jpg)
So, who are these people then?
![Page 4: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/4.jpg)
Bachelor: B.Eng ICT Master: M.Eng. Computer Engineering (specialization Distributed Systems and Software Engineering)
Experience: Software Developer @ IT Minds
Technologies: Java, C#, iOS (Objective-C/Swift), Android, JavaScript (jQuery/Ember.JS), ASP.Net MVC, SQL Server, Postgres, MongoDB, Docker, Kubernetes ...
Interests: Cloud computing/architecture, technology evolution, distributed systems, mobile development
Martin Jensen
foto: Lars Kruse, Aarhus Universitet
Bachelor: B.Eng ICT Master: M.Eng. Computer Engineering (specialization Distributed Systems and Software Engineering)
Experience: Software Developer @ IT Minds, Partner @ Drivelogger, Founder @ Let’s Talk Apple Aarhus
Technologies: Java, C#, iOS (Objective-C/Swift), Android, JavaScript (jQuery/Ember.JS), ASP.Net MVC, SQL Server, Postgres, MongoDB, Docker, Kubernetes ...
Interests: Cloud computing/architecture, technology evolution, distributed systems, mobile development
Kasper Nissen
Pervasive Systems group, Section of Electrical and Computer Engineering, Department of Engineering, Aarhus University
![Page 5: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/5.jpg)
Let’s get started with a short introduction to Cloud Computing…
![Page 6: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/6.jpg)
What is Cloud Computing?
![Page 7: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/7.jpg)
![Page 8: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/8.jpg)
- “Cloud computing refers to applications and services that run on a distributed network using virtualized resources and accessed by common Internet protocols and networking standards.” - B. Sosinsky, The Cloud Computing Bible
- Key enabling concepts
- Abstraction: Cloud computing abstracts the details of system implementation from users and developers
- Virtualization: Cloud computing virtualizes systems by pooling and sharing resources
- Cloud types
- Deployment models: Public, Private, Hybrid, Community
- Service models: IaaS, PaaS, SaaS, (CaaS)
What is Cloud Computing?
Source: “The Cloud Computing Bible”, B.Sosinsky, page 10
![Page 9: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/9.jpg)
- On-demand self-service
- Broad network access
- Resource pooling
- Rapid elasticity
- Measured service
- Lower costs
- Ease of utilization
- Quality of Service
- Reliability
- Outsourced IT Management
Benefits of Cloud Computing?
Source: “The Cloud Computing Bible”, B.Sosinsky, page 17
![Page 10: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/10.jpg)
- More suitable for large organizations
- Less customizable
- Latency
- Privacy and security
Disadvantages of Cloud Computing?
Source: “The Cloud Computing Bible”, B.Sosinsky, page 17
![Page 11: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/11.jpg)
What about Software Architecture?
![Page 12: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/12.jpg)
Source: http://reiserobby.de/norwegen-trauer-um-todesopfer-von-oslo-und-utoya-mindestens-87-tote/os_monolith/ Source: https://thirdeyemom.com/2015/07/07/the-great-american-road-trip-mount-rushmore/
Monolithic architecture
“A monolith application, in layman terms, is where entire functionality of the application is packaged together as a single unit or application” - Arun Gupta, 2015
![Page 13: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/13.jpg)
Source: http://reiserobby.de/norwegen-trauer-um-todesopfer-von-oslo-und-utoya-mindestens-87-tote/os_monolith/
Microservice architecture
“Small Autonomous services that work together, modelled around a business domain” - Sam Newman, 2015
Source: http://d195zpdxad0ld.cloudfront.net/media/W1siZiIsIjIwMTIvMDUvMjUvMTVfMDVfMjhfNjkwX1N0b25laGVuZ2VfYXRfZGF3bi5qcGciXSxbImUiLCJqcGciLCItcXVhbGl0eSA2MCJdLFsicCIsInN0cmlwIl1d/Stonehenge%20at%20dawn.jpg
![Page 14: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/14.jpg)
Monolithic vs Microservice architecture
Source: http://martinfowler.com/articles/microservices.html
![Page 15: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/15.jpg)
Design for failure - Resilience in a distributed system?
![Page 16: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/16.jpg)
resilience or resiliency
[ri-zil-yuh ns, -zil-ee-uh ns]
noun 1. the power or ability to return to the original form, position, etc., after being bent,
compressed, or stretched: elasticity. 2. ability to recover readily from illness, depression, adversity, or the like; buoyancy
Source: http://www.dictionary.com/browse/resilience
![Page 17: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/17.jpg)
![Page 18: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/18.jpg)
THINGS WILL GO WRONG EMBRACE FAILURES
![Page 19: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/19.jpg)
The fallacies of distributed computing
1. The network is reliable 2. Latency is zero 3. Bandwidth is infinite 4.The network is secure 5. Topology doesn’t change 6. There is one administrator 7. Transport cost is zero 8. The network is homogeneous
![Page 20: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/20.jpg)
- Application level
- Synchronous/Asynchronous architecture (request/response, message queues)
- Apply circuit breakers at integration points
- Rather degradation of service than failures
- Manage timeouts
- Bulkheads
- Health checks
- Infrastructure level
- Fault tolerance
- Infrastructure that detects failures
What can we do?
![Page 21: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/21.jpg)
What is a Container?
![Page 22: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/22.jpg)
![Page 23: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/23.jpg)
The challenges
Source: http://pointful.github.io/docker-intro/
![Page 24: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/24.jpg)
Intermodal shipping container
Source: http://pointful.github.io/docker-intro/
![Page 25: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/25.jpg)
Docker is a container system for code
Source: http://pointful.github.io/docker-intro/
![Page 26: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/26.jpg)
What is Continuous Delivery?
![Page 27: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/27.jpg)
Source: https://www.robots.com/images/Robot%20Integration.jpg
![Page 28: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/28.jpg)
What is Service Discovery?
![Page 29: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/29.jpg)
![Page 30: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/30.jpg)
A little tour of the
![Page 32: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/32.jpg)
Who uses Google Cloud Platform?
![Page 33: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/33.jpg)
![Page 34: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/34.jpg)
![Page 35: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/35.jpg)
An overview of all the goodies
![Page 36: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/36.jpg)
An overview of all the goodies
![Page 37: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/37.jpg)
An overview of all the goodies
![Page 38: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/38.jpg)
An overview of all the goodies
![Page 39: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/39.jpg)
An overview of all the goodies
![Page 40: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/40.jpg)
An overview of all the goodies
![Page 41: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/41.jpg)
An overview of all the goodies
![Page 42: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/42.jpg)
Google Cloud Compute
![Page 43: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/43.jpg)
Google Container Engine
Fully Managed Container Engine is fully managed by Google reliability engineers, ensuring your cluster is available and up-to-date.
Private Container Registry Google Container Registry makes it easy to store and access your private Docker images.
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 common Docker container format.
Logging Enable Google Cloud Logging with a single checkbox, 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 Cloud VPN.
Source: https://cloud.google.com/container-engine/
![Page 44: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/44.jpg)
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 with native 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 V2 API.
Docker CLI Integration Pull container images from Container Registry using the standard Docker command line interface.
Regional Repositories Get the fastest possible pull times by storing your images close to your Compute Engine instances in Europe, Asia, or US regional Cloud Storage buckets.
Search Images Quickly search for images by name and tag.
Nearline Storage Integration Archival storage of images in Cloud Storage Nearline buckets.
Source: https://cloud.google.com/container-registry/
![Page 45: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/45.jpg)
Kubernetes - Infrastructure For Everyone ElseKubernetes is an open-source system for automating deployment, operations, and scaling of containerized applications.
#GIFEE
![Page 46: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/46.jpg)
![Page 47: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/47.jpg)
How to manage all these containers?
![Page 48: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/48.jpg)
![Page 49: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/49.jpg)
How to utilize the resources we have?
![Page 50: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/50.jpg)
Machine utilization
- Machine shapes
- Workload shapes
- Bin packing problem
Where should we deploy this workload?2.5GB 1Core
Source: bit.ly/1PrkwoN
![Page 51: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/51.jpg)
Let’s play some tetris
![Page 52: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/52.jpg)
“Containerization transforms the data center from being machine-oriented to being application-oriented”
Burns et al., Borg, Omega, and Kubernetes, 2016
Source: research.google.com/pubs/pub44843.html
![Page 53: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/53.jpg)
- Greek for “pilot” or “helmsman of a ship”
- Runs and manages containers
- Builds on Googles experiences running a hyper-scale webplatform for more than 10 years.
- Inspired by Googles internal Cluster Management and scheduling platform, “Borg”
- Supports multiple cloud and bare-metal environments
- 100% Open source, written in Go
What is Kubernetes?
Source: https://youtu.be/_xNFt7FsWaA
![Page 56: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/56.jpg)
Everything at Google runs in containers - Gmail, Web search, …
- MapReduce, batch, …
- GFS, Colossus, …
- Even Google’s Cloud Platform:VMs run in containers
In fact, launches over 2 billion containers per week.
Google and Containers
![Page 57: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/57.jpg)
How does it work?
![Page 58: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/58.jpg)
Let’s have a look a some of the concepts
![Page 59: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/59.jpg)
Pods
![Page 60: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/60.jpg)
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
- “A pod is a collection of containers that are tightly bound”, Brian Dorsey
- The atom of scheduling for containers
- Runs on the same virtual/physical host
![Page 61: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/61.jpg)
Pods
Pod
Web server
Container
Pod
Web server
Consumers
Container
Git sync
Container
Git repoConsumers
Inspiration: http://bit.ly/1rmC0cz
![Page 62: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/62.jpg)
Pod networking
![Page 63: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/63.jpg)
Pod networking
- Pods have IPs which are routable
- Pods can communicate directly with each other
- Even across nodes
- No brokering of Port Numbers
- Many solutions
- Flannel (what we use in the Raspberry Pi Cluster)
- Cloud Providers
![Page 64: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/64.jpg)
Pod networking
Pod
Container
10.1.2.106
10.1.2.0/24
Pod
Container
10.1.1.211
10.1.1.0/24
Pod
Container
10.1.3.175
10.1.3.0/24
Node
Node
Node
Inspiration: http://bit.ly/1rmC0cz
![Page 65: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/65.jpg)
Services
![Page 66: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/66.jpg)
Services
- A service has a static IP and a DNS entry
- Acts as a load-balancer and knows how to route traffic to pods
- Load balances incoming request across constituent pods
![Page 67: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/67.jpg)
Services
Pod
Web server
Container
Pod
Web server
Container
Pod
Web server
Container
type=FE type=FE type=FE
Consumers
Service
VIP
Label selector: type=FE
Inspiration: http://bit.ly/1rmC0cz
![Page 68: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/68.jpg)
Labels
![Page 69: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/69.jpg)
Labels
- Labels are simple key/value pairs
- Kubernetes connects things together with labels
- Only grouping mechanism in Kubernetes
- Reduces coupling
Web server
Container
track=staging
app=webserver
tier=frontend
Pod
![Page 70: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/70.jpg)
Labels
Pod
Container
type=FE
Pod
Container
type=FE
Pod
Container
version=2
version=2
Dashboard Dashboard
show: type=FE show: version=v2
Inspiration: http://bit.ly/1rmC0cz
![Page 71: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/71.jpg)
Replica Sets
Hey! You always wear the same as I do
![Page 72: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/72.jpg)
ReplicaSets
- A Replica Set ensures that a specified number of pods “replicas” are running at any given time.
- Replica Set is the next-generation Replication Controller
- The only difference right now is the selector support (set-based support)
- Use deployments to control your Replica Sets
![Page 73: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/73.jpg)
Replica Sets
Pod
Container
type=FE
Pod
Container
type=FE
Pod
Container
type=FE
Dashboard Dashboard
Current: 3 Desired: 3
Deployment
![Page 75: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/75.jpg)
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.
![Page 76: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/76.jpg)
Deployments
Pod
Container
type=FE
Pod
Container
type=FE
Pod
Container
type=FE
Dashboard
Current: 3 Desired: 3
version=2 version=2 version=2
Pod
Container
type=FE
version=3
New version
Deployment
![Page 77: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/77.jpg)
Deployments
Pod
Container
type=FE
Pod
Container
type=FE
Pod
Container
type=FE
Dashboard
version=3 version=2 version=2
Deployment
Current: 3 Desired: 3
![Page 78: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/78.jpg)
Deployments
Pod
Container
type=FE
Pod
Container
type=FE
Pod
Container
type=FE
Dashboard
version=3 version=3 version=2
Deployment
Current: 3 Desired: 3
![Page 79: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/79.jpg)
Deployments
Pod
Container
type=FE
Pod
Container
type=FE
Pod
Container
type=FE
Dashboard
version=3 version=3 version=3
Deployment
Current: 3 Desired: 3
![Page 80: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/80.jpg)
Source: http://imgur.com/tjD4L
Canary
WHAZZZAH! I’m the new kid
on the stick!
![Page 81: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/81.jpg)
Canary
- Running different versions at the same time
- Testing new features with a subset of your users
![Page 82: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/82.jpg)
Canary
Pod
Container
type=BE
Pod
Container
type=BE
Pod
Container
type=BE
Dashboard Dashboard
Deployment
version=1 type=BE
Current: 2 Desired: 2
Deployment
version=2version=1version=1
version=2 type=BE
Current: 1 Desired: 1
Consumers
Service
VIP
name=backend Label selector: type=BE
Inspiration: http://bit.ly/1rmC0cz
![Page 84: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/84.jpg)
Scale (auto)
- Horizontal Pod Autoscaler allows you to automatically scale the number of pods in a deployment based on observed CPU utilization.
- The autoscaler is implemented as a Kubernetes API resource and controller.
- The resource describes behavior of the controller
- 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.
![Page 85: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/85.jpg)
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
![Page 86: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/86.jpg)
Demo application
UI/Gateway
Cat-service Dog-serviceconfi
g-se
rvice
![Page 87: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/87.jpg)
Demo on Raspberry Pi Kubernetes cluster
![Page 88: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/88.jpg)
How can I get started with Kubernetes?
![Page 89: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/89.jpg)
cloud.google.com
- kubernetes.io
- Documentation, great samples, etc.
- Slack: http://slack.k8s.io
- Github: https://github.com/kubernetes/kubernetes
- Pricing:
60 days free trial. You get $300 in credit.
https://cloud.google.com/free-trial/
![Page 90: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/90.jpg)
Demo on Google Container Engine
![Page 91: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/91.jpg)
Thank you
Google Developer Group Aarhus Meet-up Thursday, 28th April 2016
Martin Jensen & Kasper Nissen
www.rpi-cloud.com
@mrjensens @phennex
![Page 92: Google Cloud Platform and Kubernetes](https://reader035.vdocuments.site/reader035/viewer/2022081512/5879a2f51a28ab082c8b62e7/html5/thumbnails/92.jpg)
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”
- pointful.github.io/docker-intro/