SlideShare a Scribd company logo
1 of 39
Download to read offline
Copyright © 2015 Mirantis, Inc. All rights reserved
www.mirantis.com
Kubernetes deployment models
(modelling complex applications in K8S)
Dec8 2016
Piotr Siwczak
(https://www.linkedin.com/in/psiwczak)
Copyright © 2015 Mirantis, Inc. All rights reserved
Agenda
● Challenges in managing complex microservice architectures
● What’s missing in K8S to manage complex microservice architectures
efficiently
● K8S AppController as an enhancement to handle complex architectures
● Demo of AppController
● Q&A about AppController
Copyright © 2015 Mirantis, Inc. All rights reserved
Challenges in managing
microservice architectures
Copyright © 2015 Mirantis, Inc. All rights reserved
Linux as a microservice apps platform
Collection of small, independent programs acting together to
form larger systems.
Programs communicate over standardized protocols/API-s
Abstracts computing resources (kernel)
Copyright © 2015 Mirantis, Inc. All rights reserved
Unix/Linux simplified architecture
Kernel
Libraries
Init system Interactive shell
Userspace apps
Resource access
Orchestration
User functionality
Copyright © 2015 Mirantis, Inc. All rights reserved
The role of init system
SysVInit … Upstart … Systemd
Init makes sure that apps start in proper order and deps for
them are handled
e.g.
Network subsystem -> Iptables -> ssh
Copyright © 2015 Mirantis, Inc. All rights reserved
Apps - combined K8S resources
Kubernetes clients (kubectl...)
Kubernetes resources (pod, service…)
Unix/Linux vs K8S
Kernel
Libraries
Init system Interactive shell
Userspace apps
?
Copyright © 2015 Mirantis, Inc. All rights reserved
Do we have init equivalent in k8s?
Original photo by https://www.flickr.com/people/waferboard/ License: CC BY v2.0, Title: “wholesome stirfry”
“Containers start in
parallel after volumes are
mounted, leaving no
opportunity for
coordination between
containers...”
https://github.com/kubernetes/kubernetes/blob/master/
docs/proposals/container-init.md
Copyright © 2015 Mirantis, Inc. All rights reserved
...to make a good dish one needs to follow steps
Original photo by https://www.flickr.com/people/waferboard/ License: CC BY v2.0, Title: “wholesome stirfry”
● heat oil
● add garlic
● add veggies and sauce
● add meat
Copyright © 2015 Mirantis, Inc. All rights reserved
K8S challenge for complex apps
(T3) wordpress depl/service
(T2) mysql depl/service
(T1) mysql password
password
db dns name
& password
kubectl create -f mysql-pass.yaml
kubectl create -f mysql-deployment.yaml
kubectl create -f wordpress-deplyment.yaml
Copyright © 2015 Mirantis, Inc. All rights reserved
Is lack of deps really a problem for K8S?
We all know microservices are supposed to orchestrate
themselves and tolerate failures
...but…
Copyright © 2015 Mirantis, Inc. All rights reserved
...deps seem to be needed
https://blog.xebialabs.com/2015/04/13/before-you-go-over-the-container-cliff-with-docker-mesos-etc-po
ints-to-consider/
“"A common definition for a microservice we often hear mentioned is an
“independently-deployable unit”, and indeed it is good practice to design your
microservices so they can start up successfully without requiring all kinds of other
components to be available. But in the vast majority of cases, “no microservice is an
island”...
Copyright © 2015 Mirantis, Inc. All rights reserved
...deps seem to be needed
Docker-compose and Mesos application groups are here and being used:
https://docs.docker.com/compose/gettingstarted/
https://mesosphere.github.io/marathon/docs/application-groups.html
Copyright © 2015 Mirantis, Inc. All rights reserved
...deps seem to be needed
https://github.com/vishnubob/wait-for-it
Copyright © 2015 Mirantis, Inc. All rights reserved
...deps seem to be needed
https://github.com/mesosphere/kubernetes-mesos/issues/119
http://stackoverflow.com/questions/27701994/specify-order-dockers-run-on-kube
rnetes-pod
https://github.com/kubernetes/kubernetes/issues/29804
Copyright © 2015 Mirantis, Inc. All rights reserved
https://github.com/Mirantis/k8s-AppController
AppController
Copyright © 2015 Mirantis, Inc. All rights reserved
● way to express dependencies between K8S objects,
● thus allowing to deploy complex, multi-tier applications
in fully automated fashion
● k8s object dependency graph:
● definitions (nodes)
● dependencies (edges)
AppController - really short summary...
Copyright © 2015 Mirantis, Inc. All rights reserved
Before…
● kubectl create -f t1.yaml
● check status…
● kubectl create -f t2.yaml
● check status…
● kubectl create -f t3.yaml
● ….
After…
● kubectl create -f
graph.yaml
● k8s-appcontroller ac-run
Copyright © 2015 Mirantis, Inc. All rights reserved
AppController architecture
Kubernetes
k8s-appcontroller pod
kubeac binary k8s API
extensions
3rd party resources:
dependency
definition
Copyright © 2015 Mirantis, Inc. All rights reserved
workflow
AppController
Copyright © 2015 Mirantis, Inc. All rights reserved
AppController workflow - definitions
Definition
Standard K8S
resource
(deployment, pod,
service…)
Definition
Standard K8S
resource
(deployment, pod,
service…)
Definition
Standard K8S
resource
(deployment, pod,
service…)
Definition
Standard K8S
resource
(deployment, pod,
service…)
kubectl create -f definitions.yaml
Copyright © 2015 Mirantis, Inc. All rights reserved
AppController workflow - definitions
apiVersion: appcontroller.k8s/v1alpha1
kind: Definition
metadata:
name: secret-mysql-pass
secret:
apiVersion: v1
data:
password.txt: cXdxd3F3
kind: Secret
metadata:
creationTimestamp: 2016-12-06T16:56:02Z
name: mysql-pass
namespace: default
secret/mysql-pass
Standard K8S
resource
(secret)
Objects are not created in k8s until triggered by
AppController!
Copyright © 2015 Mirantis, Inc. All rights reserved
Definitions - summary
Definition:
● “node” in the graph
● wrapper over regular k8s resource
● defers the creation of the resource until triggered (in
contrary to “kubectl create -f” which creates the resource
immediately
Copyright © 2015 Mirantis, Inc. All rights reserved
AppController - dependencies
Definition
Standard K8S
resource
(deployment, pod,
service…)
Definition
Standard K8S
resource
(deployment, pod,
service…)
Definition
Standard K8S
resource
(deployment, pod,
service…)
Definition
Standard K8S
resource
(deployment, pod,
service…)
start end
kubectl create -f deps.yaml
Copyright © 2015 Mirantis, Inc. All rights reserved
AppController - dependencies
apiVersion: appcontroller.k8s/v1alpha1
kind: Dependency
metadata:
name: mysql-pass--to--mysql-deployment
parent: secret/mysql-pass
child: deployment/mysql
secret/mysql-pass
Standard K8S
resource
(secret)
deployment/mysql
Standard K8S
resource
(deployment)
Copyright © 2015 Mirantis, Inc. All rights reserved
Dependencies - summary
Dependency:
● “edge” in the graph
● links definitions together
● provides the sense of dependency between definitions
Copyright © 2015 Mirantis, Inc. All rights reserved
AppController - application rollout
Definition
Standard K8S
resource
(deployment, pod,
service…)
Definition
Standard K8S
resource
(deployment, pod,
service…)
Definition
Standard K8S
resource
(deployment, pod,
service…)
Definition
Standard K8S
resource
(deployment, pod,
service…)
start end
kubectl exec k8s-appcontroller ac-run
kubectl exec k8s-appcontroller kubeac
get-status
Copyright © 2015 Mirantis, Inc. All rights reserved
AppController workflow - summary
● “wrap” regular k8s resources into definitions > defs.yaml
● load defs.yaml to k8s
● create dependencies between resources > deps.yaml
● load deps.yaml into k8s
● trigger the app deployment from AppController
application (kubectl exec k8s-appcontroller ac-run)
Copyright © 2015 Mirantis, Inc. All rights reserved
MySQL + Wordpress
Demo
Copyright © 2015 Mirantis, Inc. All rights reserved
def_db_password
AppController - wordpress deployment
secret:
db_password
def_db_deploymt
deployment:
mysql-deploym
ent
def_db_service
service:
db_service
def_wp_deploymt
deployment:
wordpress-dep
loyment
def_wp_service
service:
wordpress-ser
vice
DB_PASS
DB_HOSTNAME, DB_PASS
Copyright © 2015 Mirantis, Inc. All rights reserved
Questions/Answers
Copyright © 2015 Mirantis, Inc. All rights reserved
Q&A
Q:
What if I abort the deployment in the middle - how does AppController recover
from partially provisioned graph?
A:
AppController will check the status of already provisioned resources. Will only
provision the ones which are absent
Copyright © 2015 Mirantis, Inc. All rights reserved
Q&A
Q:
Can I run multiple AppControllers on a single K8S ?
A:
You can run 1 AppController per namespace
Copyright © 2015 Mirantis, Inc. All rights reserved
Q&A
Q:
What K8S resources can be currently wrapped into definitions?
A:
- Daemonset
- Job
- Petset
- Pod
- Replicaset
- Service
- ConfigMap
- Secrets
- Deployments
Copyright © 2015 Mirantis, Inc. All rights reserved
Q&A
Q:
How is provisioning of resources validated?
A:
Status of the k8s resource is checked.
AppController implements also some checks of its own (e.g. for replicasets
readiness probe is based on “success factor” or all resources ready. Success
factor is a part of appcontroller and for services we are checking service selector
and see if the backends are ready - e.g. replica sets)
Copyright © 2015 Mirantis, Inc. All rights reserved
Q&A
Q:
What’s on the roadmap?
A:
Graph notifications, reactions, error handling
More resources supported
Usability improvements
Better documentation (incl. real-life complex examples)
Copyright © 2015 Mirantis, Inc. All rights reserved
Q&A
Q:
How AppController is different from Init Containers?
A:
Supports more complex deployments (complex graphs)
Handles deps not only between containers
Checks resource states (no need to implement custom probes in the container)
Keeps debug logs in one place
Can react to changes in the graph
Copyright © 2015 Mirantis, Inc. All rights reserved
Recording
https://www.youtube.com/watch?v=7GSwSTtBAYo&utm_cont
ent=38600000
Copyright © 2015 Mirantis, Inc. All rights reserved
Thank you!

More Related Content

What's hot

Kubernetes One-Click Deployment: Hands-on Workshop (Munich)
Kubernetes One-Click Deployment: Hands-on Workshop (Munich)Kubernetes One-Click Deployment: Hands-on Workshop (Munich)
Kubernetes One-Click Deployment: Hands-on Workshop (Munich)
QAware GmbH
 

What's hot (20)

Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
 
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
Securing Containers - Sathyajit Bhat - Adobe - Container Conference 18
 
Simple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVMSimple tweaks to get the most out of your JVM
Simple tweaks to get the most out of your JVM
 
CDK Meetup: Rule the World through IaC
CDK Meetup: Rule the World through IaCCDK Meetup: Rule the World through IaC
CDK Meetup: Rule the World through IaC
 
Centralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container OperationsCentralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container Operations
 
Multi-Clusters Made Easy with Liqo:
Getting Rid of Your Clusters Keeping Them...
Multi-Clusters Made Easy with Liqo:
Getting Rid of Your Clusters Keeping Them...Multi-Clusters Made Easy with Liqo:
Getting Rid of Your Clusters Keeping Them...
Multi-Clusters Made Easy with Liqo:
Getting Rid of Your Clusters Keeping Them...
 
Container World 2017 - Characterizing and Contrasting Container Orchestrators
Container World 2017 - Characterizing and Contrasting Container OrchestratorsContainer World 2017 - Characterizing and Contrasting Container Orchestrators
Container World 2017 - Characterizing and Contrasting Container Orchestrators
 
Kubernetes One-Click Deployment: Hands-on Workshop (Munich)
Kubernetes One-Click Deployment: Hands-on Workshop (Munich)Kubernetes One-Click Deployment: Hands-on Workshop (Munich)
Kubernetes One-Click Deployment: Hands-on Workshop (Munich)
 
KNATIVE - DEPLOY, AND MANAGE MODERN CONTAINER-BASED SERVERLESS WORKLOADS
KNATIVE - DEPLOY, AND MANAGE MODERN CONTAINER-BASED SERVERLESS WORKLOADSKNATIVE - DEPLOY, AND MANAGE MODERN CONTAINER-BASED SERVERLESS WORKLOADS
KNATIVE - DEPLOY, AND MANAGE MODERN CONTAINER-BASED SERVERLESS WORKLOADS
 
Building Cloud Native Applications Using Spring Boot and Spring Cloud
Building Cloud Native Applications Using Spring Boot and Spring CloudBuilding Cloud Native Applications Using Spring Boot and Spring Cloud
Building Cloud Native Applications Using Spring Boot and Spring Cloud
 
K8S in prod
K8S in prodK8S in prod
K8S in prod
 
Kubernetes "Ubernetes" Cluster Federation by Quinton Hoole (Google, Inc) Huaw...
Kubernetes "Ubernetes" Cluster Federation by Quinton Hoole (Google, Inc) Huaw...Kubernetes "Ubernetes" Cluster Federation by Quinton Hoole (Google, Inc) Huaw...
Kubernetes "Ubernetes" Cluster Federation by Quinton Hoole (Google, Inc) Huaw...
 
OpenStack on Kubernetes (BOS Summit / May 2017 update)
OpenStack on Kubernetes (BOS Summit / May 2017 update)OpenStack on Kubernetes (BOS Summit / May 2017 update)
OpenStack on Kubernetes (BOS Summit / May 2017 update)
 
Intro to kubernetes
Intro to kubernetesIntro to kubernetes
Intro to kubernetes
 
The Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in KubernetesThe Operator Pattern - Managing Stateful Services in Kubernetes
The Operator Pattern - Managing Stateful Services in Kubernetes
 
Application Portability with Kubernetes (k8)
Application Portability with Kubernetes (k8)Application Portability with Kubernetes (k8)
Application Portability with Kubernetes (k8)
 
Kubernetes as Infrastructure Abstraction
Kubernetes as Infrastructure AbstractionKubernetes as Infrastructure Abstraction
Kubernetes as Infrastructure Abstraction
 
Kubernetes stack reliability
Kubernetes stack reliabilityKubernetes stack reliability
Kubernetes stack reliability
 
Serverless and Servicefull Applications - Where Microservices complements Ser...
Serverless and Servicefull Applications - Where Microservices complements Ser...Serverless and Servicefull Applications - Where Microservices complements Ser...
Serverless and Servicefull Applications - Where Microservices complements Ser...
 
MongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
MongoDB.local Austin 2018: MongoDB Ops Manager + KubernetesMongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
MongoDB.local Austin 2018: MongoDB Ops Manager + Kubernetes
 

Similar to Sf bay area Kubernetes meetup dec8 2016 - deployment models

Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
QAware GmbH
 

Similar to Sf bay area Kubernetes meetup dec8 2016 - deployment models (20)

Operating Kubernetes at Scale (Australia Presentation)
Operating Kubernetes at Scale (Australia Presentation)Operating Kubernetes at Scale (Australia Presentation)
Operating Kubernetes at Scale (Australia Presentation)
 
Kubernetes Docker Container Implementation Ppt PowerPoint Presentation Slide ...
Kubernetes Docker Container Implementation Ppt PowerPoint Presentation Slide ...Kubernetes Docker Container Implementation Ppt PowerPoint Presentation Slide ...
Kubernetes Docker Container Implementation Ppt PowerPoint Presentation Slide ...
 
Running Kubernetes with Amazon EKS - AWS Online Tech Talks
Running Kubernetes with Amazon EKS - AWS Online Tech TalksRunning Kubernetes with Amazon EKS - AWS Online Tech Talks
Running Kubernetes with Amazon EKS - AWS Online Tech Talks
 
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
 
Concevoir et déployer vos applications a base de microservices sur Cloud Foundry
Concevoir et déployer vos applications a base de microservices sur Cloud FoundryConcevoir et déployer vos applications a base de microservices sur Cloud Foundry
Concevoir et déployer vos applications a base de microservices sur Cloud Foundry
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
 
Accelerating the Software Delivery Pipelinewith Mirantis OpenStack
Accelerating the Software Delivery Pipelinewith Mirantis OpenStackAccelerating the Software Delivery Pipelinewith Mirantis OpenStack
Accelerating the Software Delivery Pipelinewith Mirantis OpenStack
 
[2015-11월 정기 세미나] Cloud Native Platform - Pivotal
[2015-11월 정기 세미나] Cloud Native Platform - Pivotal[2015-11월 정기 세미나] Cloud Native Platform - Pivotal
[2015-11월 정기 세미나] Cloud Native Platform - Pivotal
 
Kolla - containerizing the cloud itself
Kolla - containerizing the cloud itselfKolla - containerizing the cloud itself
Kolla - containerizing the cloud itself
 
Masterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM RolesMasterless Puppet Using AWS S3 Buckets and IAM Roles
Masterless Puppet Using AWS S3 Buckets and IAM Roles
 
Webinar: Operating Kubernetes at Scale
Webinar: Operating Kubernetes at ScaleWebinar: Operating Kubernetes at Scale
Webinar: Operating Kubernetes at Scale
 
Driving Digital Transformation With Containers And Kubernetes Complete Deck
Driving Digital Transformation With Containers And Kubernetes Complete DeckDriving Digital Transformation With Containers And Kubernetes Complete Deck
Driving Digital Transformation With Containers And Kubernetes Complete Deck
 
Docker Orchestrators
Docker OrchestratorsDocker Orchestrators
Docker Orchestrators
 
Tech Talk: Harness the Power of Innovations Like Microservice Architecture an...
Tech Talk: Harness the Power of Innovations Like Microservice Architecture an...Tech Talk: Harness the Power of Innovations Like Microservice Architecture an...
Tech Talk: Harness the Power of Innovations Like Microservice Architecture an...
 
Cloud expo 2015_rags
Cloud expo 2015_ragsCloud expo 2015_rags
Cloud expo 2015_rags
 
AppSphere 15 - Monitoring Cloud Native Apps on Pivotal Cloud Foundry with App...
AppSphere 15 - Monitoring Cloud Native Apps on Pivotal Cloud Foundry with App...AppSphere 15 - Monitoring Cloud Native Apps on Pivotal Cloud Foundry with App...
AppSphere 15 - Monitoring Cloud Native Apps on Pivotal Cloud Foundry with App...
 
Application Portability with Kubernetes (CMP310-S) - AWS re:Invent 2018
Application Portability with Kubernetes (CMP310-S) - AWS re:Invent 2018Application Portability with Kubernetes (CMP310-S) - AWS re:Invent 2018
Application Portability with Kubernetes (CMP310-S) - AWS re:Invent 2018
 
Cloud Foundry Diego, Lattice, Docker and more
Cloud Foundry Diego, Lattice, Docker and moreCloud Foundry Diego, Lattice, Docker and more
Cloud Foundry Diego, Lattice, Docker and more
 
What's new in Pivotal Cloud Foundry 1.6
What's new in Pivotal Cloud Foundry 1.6What's new in Pivotal Cloud Foundry 1.6
What's new in Pivotal Cloud Foundry 1.6
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
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)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
"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 ...
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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
 
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
 
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, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Sf bay area Kubernetes meetup dec8 2016 - deployment models

  • 1. Copyright © 2015 Mirantis, Inc. All rights reserved www.mirantis.com Kubernetes deployment models (modelling complex applications in K8S) Dec8 2016 Piotr Siwczak (https://www.linkedin.com/in/psiwczak)
  • 2. Copyright © 2015 Mirantis, Inc. All rights reserved Agenda ● Challenges in managing complex microservice architectures ● What’s missing in K8S to manage complex microservice architectures efficiently ● K8S AppController as an enhancement to handle complex architectures ● Demo of AppController ● Q&A about AppController
  • 3. Copyright © 2015 Mirantis, Inc. All rights reserved Challenges in managing microservice architectures
  • 4. Copyright © 2015 Mirantis, Inc. All rights reserved Linux as a microservice apps platform Collection of small, independent programs acting together to form larger systems. Programs communicate over standardized protocols/API-s Abstracts computing resources (kernel)
  • 5. Copyright © 2015 Mirantis, Inc. All rights reserved Unix/Linux simplified architecture Kernel Libraries Init system Interactive shell Userspace apps Resource access Orchestration User functionality
  • 6. Copyright © 2015 Mirantis, Inc. All rights reserved The role of init system SysVInit … Upstart … Systemd Init makes sure that apps start in proper order and deps for them are handled e.g. Network subsystem -> Iptables -> ssh
  • 7. Copyright © 2015 Mirantis, Inc. All rights reserved Apps - combined K8S resources Kubernetes clients (kubectl...) Kubernetes resources (pod, service…) Unix/Linux vs K8S Kernel Libraries Init system Interactive shell Userspace apps ?
  • 8. Copyright © 2015 Mirantis, Inc. All rights reserved Do we have init equivalent in k8s? Original photo by https://www.flickr.com/people/waferboard/ License: CC BY v2.0, Title: “wholesome stirfry” “Containers start in parallel after volumes are mounted, leaving no opportunity for coordination between containers...” https://github.com/kubernetes/kubernetes/blob/master/ docs/proposals/container-init.md
  • 9. Copyright © 2015 Mirantis, Inc. All rights reserved ...to make a good dish one needs to follow steps Original photo by https://www.flickr.com/people/waferboard/ License: CC BY v2.0, Title: “wholesome stirfry” ● heat oil ● add garlic ● add veggies and sauce ● add meat
  • 10. Copyright © 2015 Mirantis, Inc. All rights reserved K8S challenge for complex apps (T3) wordpress depl/service (T2) mysql depl/service (T1) mysql password password db dns name & password kubectl create -f mysql-pass.yaml kubectl create -f mysql-deployment.yaml kubectl create -f wordpress-deplyment.yaml
  • 11. Copyright © 2015 Mirantis, Inc. All rights reserved Is lack of deps really a problem for K8S? We all know microservices are supposed to orchestrate themselves and tolerate failures ...but…
  • 12. Copyright © 2015 Mirantis, Inc. All rights reserved ...deps seem to be needed https://blog.xebialabs.com/2015/04/13/before-you-go-over-the-container-cliff-with-docker-mesos-etc-po ints-to-consider/ “"A common definition for a microservice we often hear mentioned is an “independently-deployable unit”, and indeed it is good practice to design your microservices so they can start up successfully without requiring all kinds of other components to be available. But in the vast majority of cases, “no microservice is an island”...
  • 13. Copyright © 2015 Mirantis, Inc. All rights reserved ...deps seem to be needed Docker-compose and Mesos application groups are here and being used: https://docs.docker.com/compose/gettingstarted/ https://mesosphere.github.io/marathon/docs/application-groups.html
  • 14. Copyright © 2015 Mirantis, Inc. All rights reserved ...deps seem to be needed https://github.com/vishnubob/wait-for-it
  • 15. Copyright © 2015 Mirantis, Inc. All rights reserved ...deps seem to be needed https://github.com/mesosphere/kubernetes-mesos/issues/119 http://stackoverflow.com/questions/27701994/specify-order-dockers-run-on-kube rnetes-pod https://github.com/kubernetes/kubernetes/issues/29804
  • 16. Copyright © 2015 Mirantis, Inc. All rights reserved https://github.com/Mirantis/k8s-AppController AppController
  • 17. Copyright © 2015 Mirantis, Inc. All rights reserved ● way to express dependencies between K8S objects, ● thus allowing to deploy complex, multi-tier applications in fully automated fashion ● k8s object dependency graph: ● definitions (nodes) ● dependencies (edges) AppController - really short summary...
  • 18. Copyright © 2015 Mirantis, Inc. All rights reserved Before… ● kubectl create -f t1.yaml ● check status… ● kubectl create -f t2.yaml ● check status… ● kubectl create -f t3.yaml ● …. After… ● kubectl create -f graph.yaml ● k8s-appcontroller ac-run
  • 19. Copyright © 2015 Mirantis, Inc. All rights reserved AppController architecture Kubernetes k8s-appcontroller pod kubeac binary k8s API extensions 3rd party resources: dependency definition
  • 20. Copyright © 2015 Mirantis, Inc. All rights reserved workflow AppController
  • 21. Copyright © 2015 Mirantis, Inc. All rights reserved AppController workflow - definitions Definition Standard K8S resource (deployment, pod, service…) Definition Standard K8S resource (deployment, pod, service…) Definition Standard K8S resource (deployment, pod, service…) Definition Standard K8S resource (deployment, pod, service…) kubectl create -f definitions.yaml
  • 22. Copyright © 2015 Mirantis, Inc. All rights reserved AppController workflow - definitions apiVersion: appcontroller.k8s/v1alpha1 kind: Definition metadata: name: secret-mysql-pass secret: apiVersion: v1 data: password.txt: cXdxd3F3 kind: Secret metadata: creationTimestamp: 2016-12-06T16:56:02Z name: mysql-pass namespace: default secret/mysql-pass Standard K8S resource (secret) Objects are not created in k8s until triggered by AppController!
  • 23. Copyright © 2015 Mirantis, Inc. All rights reserved Definitions - summary Definition: ● “node” in the graph ● wrapper over regular k8s resource ● defers the creation of the resource until triggered (in contrary to “kubectl create -f” which creates the resource immediately
  • 24. Copyright © 2015 Mirantis, Inc. All rights reserved AppController - dependencies Definition Standard K8S resource (deployment, pod, service…) Definition Standard K8S resource (deployment, pod, service…) Definition Standard K8S resource (deployment, pod, service…) Definition Standard K8S resource (deployment, pod, service…) start end kubectl create -f deps.yaml
  • 25. Copyright © 2015 Mirantis, Inc. All rights reserved AppController - dependencies apiVersion: appcontroller.k8s/v1alpha1 kind: Dependency metadata: name: mysql-pass--to--mysql-deployment parent: secret/mysql-pass child: deployment/mysql secret/mysql-pass Standard K8S resource (secret) deployment/mysql Standard K8S resource (deployment)
  • 26. Copyright © 2015 Mirantis, Inc. All rights reserved Dependencies - summary Dependency: ● “edge” in the graph ● links definitions together ● provides the sense of dependency between definitions
  • 27. Copyright © 2015 Mirantis, Inc. All rights reserved AppController - application rollout Definition Standard K8S resource (deployment, pod, service…) Definition Standard K8S resource (deployment, pod, service…) Definition Standard K8S resource (deployment, pod, service…) Definition Standard K8S resource (deployment, pod, service…) start end kubectl exec k8s-appcontroller ac-run kubectl exec k8s-appcontroller kubeac get-status
  • 28. Copyright © 2015 Mirantis, Inc. All rights reserved AppController workflow - summary ● “wrap” regular k8s resources into definitions > defs.yaml ● load defs.yaml to k8s ● create dependencies between resources > deps.yaml ● load deps.yaml into k8s ● trigger the app deployment from AppController application (kubectl exec k8s-appcontroller ac-run)
  • 29. Copyright © 2015 Mirantis, Inc. All rights reserved MySQL + Wordpress Demo
  • 30. Copyright © 2015 Mirantis, Inc. All rights reserved def_db_password AppController - wordpress deployment secret: db_password def_db_deploymt deployment: mysql-deploym ent def_db_service service: db_service def_wp_deploymt deployment: wordpress-dep loyment def_wp_service service: wordpress-ser vice DB_PASS DB_HOSTNAME, DB_PASS
  • 31. Copyright © 2015 Mirantis, Inc. All rights reserved Questions/Answers
  • 32. Copyright © 2015 Mirantis, Inc. All rights reserved Q&A Q: What if I abort the deployment in the middle - how does AppController recover from partially provisioned graph? A: AppController will check the status of already provisioned resources. Will only provision the ones which are absent
  • 33. Copyright © 2015 Mirantis, Inc. All rights reserved Q&A Q: Can I run multiple AppControllers on a single K8S ? A: You can run 1 AppController per namespace
  • 34. Copyright © 2015 Mirantis, Inc. All rights reserved Q&A Q: What K8S resources can be currently wrapped into definitions? A: - Daemonset - Job - Petset - Pod - Replicaset - Service - ConfigMap - Secrets - Deployments
  • 35. Copyright © 2015 Mirantis, Inc. All rights reserved Q&A Q: How is provisioning of resources validated? A: Status of the k8s resource is checked. AppController implements also some checks of its own (e.g. for replicasets readiness probe is based on “success factor” or all resources ready. Success factor is a part of appcontroller and for services we are checking service selector and see if the backends are ready - e.g. replica sets)
  • 36. Copyright © 2015 Mirantis, Inc. All rights reserved Q&A Q: What’s on the roadmap? A: Graph notifications, reactions, error handling More resources supported Usability improvements Better documentation (incl. real-life complex examples)
  • 37. Copyright © 2015 Mirantis, Inc. All rights reserved Q&A Q: How AppController is different from Init Containers? A: Supports more complex deployments (complex graphs) Handles deps not only between containers Checks resource states (no need to implement custom probes in the container) Keeps debug logs in one place Can react to changes in the graph
  • 38. Copyright © 2015 Mirantis, Inc. All rights reserved Recording https://www.youtube.com/watch?v=7GSwSTtBAYo&utm_cont ent=38600000
  • 39. Copyright © 2015 Mirantis, Inc. All rights reserved Thank you!