SlideShare a Scribd company logo
1 of 44
Download to read offline
Kubernetes & CoreOS
Athens Docker Meetup
1. What is your
name?
Chris Loukas
Dimitris Moraitis
2. What is your
quest?
● Self-healing services
● Auto-scaling
● 1-click deployments/rollbacks
● More vacations
To find the holy grail of DevOps.
3. What is your
favorite systems
architecture?
It usually goes like this ...
For early or later stage products?
Begin with a bunch of monoliths
Turn it into a solid stack of reusable components
Keep iterating until you end up with mosaics of micro-services
Chapter 1
the container A lightweight VM?
A chrooted process?
An application packaging technology?
Containers kick ass despite limitations
● Great for dev on a single node.
● Ideal for CI.
● It gets tricky in multi-node
production environments.
● A lot of hacking required to
orchestrate deployments,
rollback, scale, monitor,
migrate.
Chapter 2
CoreOS
A lightweight Linux distro for clustered
deployments that uses containers to
manage your services at a higher level
of abstraction, instead of installing
packages via yum or apt.
etcd
● A distributed key-value store that
provides a reliable way to store data
across a cluster of machines.
● Values can be watched, to trigger
app reconfigurations when they
change.
● Odd sized clusters guaranteed to
reach consensus.
● JSON/REST API.
flannel
● An etcd backed network
fabric for containers.
● A virtual network that
gives a subnet to each
host for use with
container runtimes.
fleet
● An etcd backed,
distributed init system
(distributed systemd).
● Treat CoreOS cluster as if
it shared an init system.
● Graceful updates of
CoreOS across the cluster.
● Handles machine failures.
fleet
rkt
● Container runtime by
CoreOS
● rkt is an implementation
of the App Container Spec
● rkt features native support
for fetching and running
Docker container images
Chapter 3
Kubernetes
Kubernetes is an open source
orchestration system for containers.
● kube-apiserver
● kube-scheduler
● kube-controller-manager
● kube-kubelet
● kube-proxy
Master
Nodes
Pods
● A collocated group of containers
with shared volumes. Always
executed on the same node.
● The smallest deployable units.
● Correspond to a colocated group of
applications running with shared
context.
Replication controllers
● Ensure that a specific
number of pod replicas are
running at any one time.
● Replace pods that are
deleted or terminated.
● Get rid of excess pods.
Labels
● Key-value pairs attached to
pods and other resources.
● Specify identifying
properties of resources.
● Sets of objects can be
identified by label selectors
(e.g. version=2).
Services
● An abstraction that uses a
selector to map an incoming
port to a set of pods.
● Needed to keep stable front-
ends since pods are mortal
and each pod gets its own ip
address.
Self-healing
● The user declares the
target state e.g. “I need 5
uwsgi & 10 celery servers
active at all times”.
● Kubernetes will re-start,
replicate & re-schedule
containers to ensure that
this is met.
Scaling
● By increasing or decreasing the
replication factor of each pod,
respective services will scale up
or down.
● Auto-scaling of services
depending on pod CPU
utilization.
● New nodes can be added to
increase cluster capacity.
And there was much rejoicing !
What’s the catch?
High availability of Kubernetes can
be achieved with CoreOS (e.g. fleet),
but not without some serious effort...
High availability
of Kubernetes
Used to be an issue, promised to be
resolved in Kubernetes v1.1.1
“included option to use native IP
tables offering an 80% reduction in
tail latency, an almost complete
elimination of CPU overhead “
Network
performance
Stateful services and Kubernetes do
not fit well. There are some “exotic”
ways to solve the problem, but they
are either still in beta or under heavy
development (e.g. flocker)
Stateful
services
Kubernetes is configured to work out
of the box only for GCE and EC2. In
any other case manual configuration
of load-balancers and external DNS
services is to be expected.
Public Load
Balancer
External DNS
Kubernetes on top of CoreOS is a
completely new way of doing things...
operation workflows for DevOps
should be heavily adjusted to this new
way of things…
You could end up building your own
tools around Kubernetes...
Operational
Management
Chapter 4
Developing your app
for Kubernetes
● One click deployment!
● Replicate as much of the production setup as possible
● Everything pre-configured for the developer (e.g. add-ons)
Goals for the development process:
Our experience so far...
-
Ended up building our own
internal tools
aka mistctl
everything is ctl nowadays…
does anyone remember tail -f ???
+
Works locally but not in prod???
Not the case anymore...at least
most of the times
Local dev
with
Kubernetes in
place
● Higher demands on developer’s
laptop power!
● Allows us to get rid of distro specific
dependencies.
● Adds new dependencies: vagrant &
virtualbox.
● Local dev environment is very close
to production.
Chapter 5
CI
Pre-production workflow
CI workflow
CI Workflow explanation
1. Developer opens a PR against the staging
branch on Github, triggers Jenkins job.
2. Jenkins setups the env runs the tests and
posts the results back to the PR.
3. Reviewer merges to staging branch after
manual code review.
4. Jenkins builds pre-production containers
and pushes them to the registry.
5. Jenkins triggers deploy on pre-production
cluster.
6. Jenkins runs stress tests against pre-
production cluster.
7. Reviewer compares stress test results with
previous results.
...
Chapter X
Demo
Follow along?
cloud-init: goo.gl/mtF5az
Vagrantfile: goo.gl/HBcqh3
kubectl linux: goo.gl/EZUB3k
kubectl OSX: goo.gl/KUJIOI
Next steps
Monitoring
● Locally using cAdvisor, heapster,
influxDB & Grafana.
● Externally using 3rd party
service.
● Enhance Mist.io to monitor
Kubernetes clusters and to
trigger actions based on rules.
High Availability
● For the cluster services
through fleet: multiple
masters.
● For our own services,
especially the stateful
ones (e.g. MongoDB).
Disaster Recovery
● Deploy Kubernetes cluster on
another provider or region.
● Deploy our apps on the new
cluster.
● Restore data from latest
backup or perform live
migration, depending on the
type of disaster.
Thank you!

More Related Content

What's hot

WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
Brian Grant
 
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
Neo4j
 

What's hot (20)

Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with Kubernetes
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
 
Planes, Raft, and Pods: A Tour of Distributed Systems Within Kubernetes
Planes, Raft, and Pods: A Tour of Distributed Systems Within KubernetesPlanes, Raft, and Pods: A Tour of Distributed Systems Within Kubernetes
Planes, Raft, and Pods: A Tour of Distributed Systems Within Kubernetes
 
Managing Docker Containers In A Cluster - Introducing Kubernetes
Managing Docker Containers In A Cluster - Introducing KubernetesManaging Docker Containers In A Cluster - Introducing Kubernetes
Managing Docker Containers In A Cluster - Introducing Kubernetes
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
 
2016 - Continuously Delivering Microservices in Kubernetes using Jenkins
2016 - Continuously Delivering Microservices in Kubernetes using Jenkins2016 - Continuously Delivering Microservices in Kubernetes using Jenkins
2016 - Continuously Delivering Microservices in Kubernetes using Jenkins
 
GlueCon kubernetes & container engine
GlueCon kubernetes & container engineGlueCon kubernetes & container engine
GlueCon kubernetes & container engine
 
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
An Introduction to Container Organization with Docker Swarm, Kubernetes, Meso...
 
Kubernetes 101 Workshop
Kubernetes 101 WorkshopKubernetes 101 Workshop
Kubernetes 101 Workshop
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and Kubernetes
 
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
 
Kubernetes Immersion
Kubernetes ImmersionKubernetes Immersion
Kubernetes Immersion
 
Orchestrating Docker Containers with Google Kubernetes on OpenStack
Orchestrating Docker Containers with Google Kubernetes on OpenStackOrchestrating Docker Containers with Google Kubernetes on OpenStack
Orchestrating Docker Containers with Google Kubernetes on OpenStack
 
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 and Hybrid Deployments
Kubernetes and Hybrid DeploymentsKubernetes and Hybrid Deployments
Kubernetes and Hybrid Deployments
 
What's new in Kubernetes
What's new in KubernetesWhat's new in Kubernetes
What's new in Kubernetes
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with Kubernetes
 
Monitoring microservices: Docker, Mesos and Kubernetes visibility at scale
Monitoring microservices: Docker, Mesos and Kubernetes visibility at scaleMonitoring microservices: Docker, Mesos and Kubernetes visibility at scale
Monitoring microservices: Docker, Mesos and Kubernetes visibility at scale
 
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
 

Viewers also liked

Viewers also liked (20)

Deploy at scale with CoreOS Kubernetes and Apache Stratos
Deploy at scale with CoreOS Kubernetes and Apache StratosDeploy at scale with CoreOS Kubernetes and Apache Stratos
Deploy at scale with CoreOS Kubernetes and Apache Stratos
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
 
Achieving CI/CD with Kubernetes
Achieving CI/CD with KubernetesAchieving CI/CD with Kubernetes
Achieving CI/CD with Kubernetes
 
JavaCro'15 - Docker, Kubernetes and Jube - a new cloud architecture - Aleš Ju...
JavaCro'15 - Docker, Kubernetes and Jube - a new cloud architecture - Aleš Ju...JavaCro'15 - Docker, Kubernetes and Jube - a new cloud architecture - Aleš Ju...
JavaCro'15 - Docker, Kubernetes and Jube - a new cloud architecture - Aleš Ju...
 
Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)Scale out, with Kubernetes (k8s)
Scale out, with Kubernetes (k8s)
 
Docker Multihost Networking
Docker Multihost Networking Docker Multihost Networking
Docker Multihost Networking
 
Apache Stratos 4.1.0 Architecture
Apache Stratos 4.1.0 ArchitectureApache Stratos 4.1.0 Architecture
Apache Stratos 4.1.0 Architecture
 
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
 
GKE vs OpenStack Magnum
GKE vs OpenStack MagnumGKE vs OpenStack Magnum
GKE vs OpenStack Magnum
 
Orchestrating Linux Containers
Orchestrating Linux ContainersOrchestrating Linux Containers
Orchestrating Linux Containers
 
From dev to prod: Kubernetes on AWS (short ver.)
From dev to prod: Kubernetes on AWS (short ver.)From dev to prod: Kubernetes on AWS (short ver.)
From dev to prod: Kubernetes on AWS (short ver.)
 
Kubernetes kubecon-roundup
Kubernetes kubecon-roundupKubernetes kubecon-roundup
Kubernetes kubecon-roundup
 
Single tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8SSingle tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8S
 
Tectonic Summit 2016: Multi-Cluster Kubernetes: Planning for Unknowns
Tectonic Summit 2016: Multi-Cluster Kubernetes: Planning for UnknownsTectonic Summit 2016: Multi-Cluster Kubernetes: Planning for Unknowns
Tectonic Summit 2016: Multi-Cluster Kubernetes: Planning for Unknowns
 
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
 
Docker Networking
Docker NetworkingDocker Networking
Docker Networking
 
Tutorial on using CoreOS Flannel for Docker networking
Tutorial on using CoreOS Flannel for Docker networkingTutorial on using CoreOS Flannel for Docker networking
Tutorial on using CoreOS Flannel for Docker networking
 
Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015
 
Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...Kubernetes networking: Introduction to overlay networks, communication models...
Kubernetes networking: Introduction to overlay networks, communication models...
 

Similar to Kubernetes and CoreOS @ Athens Docker meetup

Similar to Kubernetes and CoreOS @ Athens Docker meetup (20)

Docker Madison, Introduction to Kubernetes
Docker Madison, Introduction to KubernetesDocker Madison, Introduction to Kubernetes
Docker Madison, Introduction to Kubernetes
 
First steps with kubernetes
First steps with kubernetesFirst steps with kubernetes
First steps with kubernetes
 
Google Cloud Platform Kubernetes Workshop IYTE
Google Cloud Platform Kubernetes Workshop IYTEGoogle Cloud Platform Kubernetes Workshop IYTE
Google Cloud Platform Kubernetes Workshop IYTE
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Database as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on KubernetesDatabase as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on Kubernetes
 
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOpsDevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
 
Kubernetes intro
Kubernetes introKubernetes intro
Kubernetes intro
 
Distributed Tensorflow with Kubernetes - data2day - Jakob Karalus
Distributed Tensorflow with Kubernetes - data2day - Jakob KaralusDistributed Tensorflow with Kubernetes - data2day - Jakob Karalus
Distributed Tensorflow with Kubernetes - data2day - Jakob Karalus
 
Kubernetes overview and Exploitation
Kubernetes overview and ExploitationKubernetes overview and Exploitation
Kubernetes overview and Exploitation
 
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
 
Scalable Spark deployment using Kubernetes
Scalable Spark deployment using KubernetesScalable Spark deployment using Kubernetes
Scalable Spark deployment using Kubernetes
 
Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Composing services with Kubernetes
Composing services with KubernetesComposing services with Kubernetes
Composing services with Kubernetes
 
Kubernetes is all you need
Kubernetes is all you needKubernetes is all you need
Kubernetes is all you need
 
Better code, faster with kubernetes in google cloud
Better code, faster with kubernetes in google cloudBetter code, faster with kubernetes in google cloud
Better code, faster with kubernetes in google cloud
 
Intro to Kubernetes
Intro to KubernetesIntro to Kubernetes
Intro to Kubernetes
 
Gdg izmir kubernetes
Gdg izmir kubernetesGdg izmir kubernetes
Gdg izmir kubernetes
 
Successful DevOps implementation for small teams a true story
Successful DevOps implementation for small teams  a true storySuccessful DevOps implementation for small teams  a true story
Successful DevOps implementation for small teams a true story
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Kubernetes and CoreOS @ Athens Docker meetup

  • 2. 1. What is your name? Chris Loukas Dimitris Moraitis
  • 3. 2. What is your quest? ● Self-healing services ● Auto-scaling ● 1-click deployments/rollbacks ● More vacations To find the holy grail of DevOps.
  • 4. 3. What is your favorite systems architecture? It usually goes like this ... For early or later stage products?
  • 5. Begin with a bunch of monoliths
  • 6. Turn it into a solid stack of reusable components
  • 7. Keep iterating until you end up with mosaics of micro-services
  • 8. Chapter 1 the container A lightweight VM? A chrooted process? An application packaging technology?
  • 9. Containers kick ass despite limitations ● Great for dev on a single node. ● Ideal for CI. ● It gets tricky in multi-node production environments. ● A lot of hacking required to orchestrate deployments, rollback, scale, monitor, migrate.
  • 10. Chapter 2 CoreOS A lightweight Linux distro for clustered deployments that uses containers to manage your services at a higher level of abstraction, instead of installing packages via yum or apt.
  • 11. etcd ● A distributed key-value store that provides a reliable way to store data across a cluster of machines. ● Values can be watched, to trigger app reconfigurations when they change. ● Odd sized clusters guaranteed to reach consensus. ● JSON/REST API.
  • 12. flannel ● An etcd backed network fabric for containers. ● A virtual network that gives a subnet to each host for use with container runtimes.
  • 13. fleet ● An etcd backed, distributed init system (distributed systemd). ● Treat CoreOS cluster as if it shared an init system. ● Graceful updates of CoreOS across the cluster. ● Handles machine failures. fleet
  • 14. rkt ● Container runtime by CoreOS ● rkt is an implementation of the App Container Spec ● rkt features native support for fetching and running Docker container images
  • 15. Chapter 3 Kubernetes Kubernetes is an open source orchestration system for containers.
  • 16. ● kube-apiserver ● kube-scheduler ● kube-controller-manager ● kube-kubelet ● kube-proxy Master Nodes
  • 17. Pods ● A collocated group of containers with shared volumes. Always executed on the same node. ● The smallest deployable units. ● Correspond to a colocated group of applications running with shared context.
  • 18. Replication controllers ● Ensure that a specific number of pod replicas are running at any one time. ● Replace pods that are deleted or terminated. ● Get rid of excess pods.
  • 19. Labels ● Key-value pairs attached to pods and other resources. ● Specify identifying properties of resources. ● Sets of objects can be identified by label selectors (e.g. version=2).
  • 20. Services ● An abstraction that uses a selector to map an incoming port to a set of pods. ● Needed to keep stable front- ends since pods are mortal and each pod gets its own ip address.
  • 21. Self-healing ● The user declares the target state e.g. “I need 5 uwsgi & 10 celery servers active at all times”. ● Kubernetes will re-start, replicate & re-schedule containers to ensure that this is met.
  • 22. Scaling ● By increasing or decreasing the replication factor of each pod, respective services will scale up or down. ● Auto-scaling of services depending on pod CPU utilization. ● New nodes can be added to increase cluster capacity.
  • 23. And there was much rejoicing !
  • 25. High availability of Kubernetes can be achieved with CoreOS (e.g. fleet), but not without some serious effort... High availability of Kubernetes
  • 26. Used to be an issue, promised to be resolved in Kubernetes v1.1.1 “included option to use native IP tables offering an 80% reduction in tail latency, an almost complete elimination of CPU overhead “ Network performance
  • 27. Stateful services and Kubernetes do not fit well. There are some “exotic” ways to solve the problem, but they are either still in beta or under heavy development (e.g. flocker) Stateful services
  • 28. Kubernetes is configured to work out of the box only for GCE and EC2. In any other case manual configuration of load-balancers and external DNS services is to be expected. Public Load Balancer External DNS
  • 29. Kubernetes on top of CoreOS is a completely new way of doing things... operation workflows for DevOps should be heavily adjusted to this new way of things… You could end up building your own tools around Kubernetes... Operational Management
  • 30. Chapter 4 Developing your app for Kubernetes
  • 31. ● One click deployment! ● Replicate as much of the production setup as possible ● Everything pre-configured for the developer (e.g. add-ons) Goals for the development process: Our experience so far...
  • 32. - Ended up building our own internal tools aka mistctl everything is ctl nowadays… does anyone remember tail -f ???
  • 33. + Works locally but not in prod??? Not the case anymore...at least most of the times
  • 34. Local dev with Kubernetes in place ● Higher demands on developer’s laptop power! ● Allows us to get rid of distro specific dependencies. ● Adds new dependencies: vagrant & virtualbox. ● Local dev environment is very close to production.
  • 37. CI Workflow explanation 1. Developer opens a PR against the staging branch on Github, triggers Jenkins job. 2. Jenkins setups the env runs the tests and posts the results back to the PR. 3. Reviewer merges to staging branch after manual code review. 4. Jenkins builds pre-production containers and pushes them to the registry. 5. Jenkins triggers deploy on pre-production cluster. 6. Jenkins runs stress tests against pre- production cluster. 7. Reviewer compares stress test results with previous results. ...
  • 39. Follow along? cloud-init: goo.gl/mtF5az Vagrantfile: goo.gl/HBcqh3 kubectl linux: goo.gl/EZUB3k kubectl OSX: goo.gl/KUJIOI
  • 41. Monitoring ● Locally using cAdvisor, heapster, influxDB & Grafana. ● Externally using 3rd party service. ● Enhance Mist.io to monitor Kubernetes clusters and to trigger actions based on rules.
  • 42. High Availability ● For the cluster services through fleet: multiple masters. ● For our own services, especially the stateful ones (e.g. MongoDB).
  • 43. Disaster Recovery ● Deploy Kubernetes cluster on another provider or region. ● Deploy our apps on the new cluster. ● Restore data from latest backup or perform live migration, depending on the type of disaster.