SlideShare a Scribd company logo
1 of 36
Download to read offline
WebScale
infrastructures with
Kubernetes and
Flannel
Container Day
Verona
15/04/2016Andrea Tosatto
andrea.tosatto@purpleocean.eu
Outline
● Introduction to Purple Ocean
● Magento
○ The good
○ The bad
○ The ugly
● Project Picasso
○ Software Defined Overlay Networking with Flannel
○ Cluster Mangement with Kubernetes
● What’s Next
○ Geographical Distribution
○ Hybrid Cloud
Purple Ocean
LARGE
ENTERPRISES
MISSION
CRITICAL
OPERATIONS
INNOVATION
Software-defined Networking
Automation
RESEARCH
Distribuited Systems
Cloud Technologies
Purple Ocean
BLUE BUSINESS RED BUSINESS
Magento
“The high performance, scalable
eCommerce solution for fast-growing
and large businesses.”
https://magento.com/products/overview
Magento: the goods
1. Wide range of features and
functionalities
2. Integrations
3. Large community
4. Open source
5. Thousands of agencies and developers
6. Enterprise edition available
https://www.elementarydigital.co.uk/why-use-magento-for-ecommerce/
Magento
“Every 100ms of latency costs Amazon
1% of profit”
http://radar.oreilly.com/2008/08/radar-theme-web-ops.html
“Google says more searches now on
mobile than on desktop”
http://searchengineland.com/its-official-google-says-more-
searches-now-on-mobile-than-on-desktop-220369
Magento
“Every 100ms of latency costs Amazon
1% of profit”
http://radar.oreilly.com/2008/08/radar-theme-web-ops.html
“Every 100ms of latency costs Amazon
1% of profit”
http://radar.oreilly.com/2008/08/radar-theme-web-ops.html
PERFORMANCES
MATTER
Magento: the bad
Running medium-size businesses on
Magento, could require a lot of caching
layers and tricks.
Magento: the bad
45k users
350k page views
50k sessions
(per day)
require
1x
2x
+
(Caching Layer)
7x
1x
(LAMP Stack)
=
52GB RAM
80vCPU
410GB STORAGE
Magento: the ugly
Project Picasso
Project Picasso
AUTOSCALING
AND FAULT
TOLERANCE
RESOURCE
USAGE
OPTIMIZATION
AUTOMATION
Project Picasso
“Docker is an open source project
to pack, ship and run any
application as a lightweight
container. Docker containers are
both hardware-agnostic and
platform-agnostic.”
https://github.com/docker/docker
“Flannel is a virtual network that
gives a subnet to each host for
use with container runtimes.”
https://coreos.com/flannel/docs/latest/
“Kubernetes is an open-source
system for automating
deployment, operations, and
scaling of containerized
applications.”
http://kubernetes.io/
Kubernetes Architecture
PHYSICAL
INFRASTRUCTURE
(MINIONS & MASTERS)
Kubernetes Architecture
PHYSICAL
INFRASTRUCTURE
(MINIONS & MASTERS)
OVERLAY
(KUBERNETES & FLANNEL)
Kubernetes Architecture
PHYSICAL
INFRASTRUCTURE
(MINIONS & MASTERS)
OVERLAY
(KUBERNETES & FLANNEL)
PODS &
REPLICATIONS
CONTROLLERS
(APPLICATION UNITS)
Kubernetes Architecture
PHYSICAL
INFRASTRUCTURE
(MINIONS & MASTERS)
OVERLAY
(KUBERNETES & FLANNEL)
SERVICES PODS &
REPLICATIONS
CONTROLLERS
(APPLICATION UNITS)
Kubernetes Architecture
PHYSICAL
INFRASTRUCTURE
(MINIONS & MASTERS)
OVERLAY
(KUBERNETES & FLANNEL)
PODS &
REPLICATIONS
CONTROLLERS
(APPLICATION UNITS)
SERVICES
CLIENTS
(USERS & APPLICATIONS)
Persistent Volume
A PersistentVolume (PV) is a piece of networked storage in the cluster that has
been provisioned by an administrator. It is a resource in the cluster just like a
node is a cluster resource.
http://kubernetes.io/docs/user-guide/persistent-volumes/
# Allocates 5GB of storage on the given NFS server
apiVersion: v1
kind: PersistentVolume
metadata:
name: web-storage
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
nfs:
server: kube-master-1
path: "/root/nfs"
Persistent Volume
A PersistentVolume (PV) is a piece of networked storage in the cluster that has
been provisioned by an administrator. It is a resource in the cluster just like a
node is a cluster resource.
http://kubernetes.io/docs/user-guide/persistent-volumes/
# kubectl create -f web-storage-pv.yaml
persistentvolume "web-storage" created
# kubectl describe pv web-storage
Name: web-storage
Labels: <none>
Status: Available
Claim:
Reclaim Policy: Retain
Access Modes: RWX
Capacity: 5Gi
Message:
Source:
Type: NFS (an NFS mount that lasts the lifetime of a pod)
Server: kube-master-1
Path: /root/nfs
ReadOnly: false
Persistent Volume Claim
A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar
to a pod. Pods consume node resources and PVCs consume PV resources.
# This PersistentVolumeClaim claims 5GB of storage
# for the web-application.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: web-storage-claim
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
http://kubernetes.io/docs/user-guide/persistent-volumes/
Persistent Volume Claim
A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar
to a pod. Pods consume node resources and PVCs consume PV resources.
# kubectl create -f web-storage-pvc.yaml
persistentvolumeclaim "web-storage-claim" created
http://kubernetes.io/docs/user-guide/persistent-volumes/
# kubectl describe pvc web-storage
Name: web-storage-claim
Namespace: default
Status: Bound
Volume: web-storage
Labels: <none>
Capacity: 5Gi
Access Modes: RWX
Pod & ReplicationController
A ReplicationController (RC) ensures that a specified number of pod “replicas” are
running at any one time. In other words, a replication controller makes sure that a pod
or homogeneous set of pods are always up and available. If there are too many pods,
it will kill some. If there are too few, the replication controller will start more
http://kubernetes.io/docs/user-guide/replication-controller/
apiVersion: v1
kind: ReplicationController
metadata:
name: web-frontend
spec:
replicas: 2
selector:
role: web-frontend
template:
metadata:
labels:
role: web-frontend
spec:
containers:
- name: web-frontend
image: php:5.5-apache
ports:
- name: web
containerPort: 80
volumeMounts:
- name: nfs
mountPath: "/var/www/html"
volumes:
- name: nfs
persistentVolumeClaim:
claimName: web-storage-claim
# kubectl create -f web-frontend-rc.yaml
replicationcontroller "web-frontend" created
# kubectl describe rc web-frontend
Name: web-frontend
Namespace: default
Image(s): php:5.5-apache
Selector: role=web-frontend
Labels: role=web-frontend
Replicas: 2 current / 2 desired
Pods Status: 2 Running / 0 Waiting / 0 Succeeded / 0 Failed
Volumes:
nfs:
Type:PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: web-storage-claim
ReadOnly: true
[...]
Pod & ReplicationController
A ReplicationController (RC) ensures that a specified number of pod “replicas” are
running at any one time. In other words, a replication controller makes sure that a pod
or homogeneous set of pods are always up and available. If there are too many pods,
it will kill some. If there are too few, the replication controller will start more
http://kubernetes.io/docs/user-guide/replication-controller/
# Expose the web-frontend on each Minion
apiVersion: v1
kind: Service
metadata:
name: web-frontend
spec:
ports:
- port: 80
type: NodePort
selector:
role: web-frontend
Service
A Kubernetes Service (SVC) is an abstraction which defines a logical set of
Pods and a policy by which to access them - sometimes called a micro-service.
http://kubernetes.io/docs/user-guide/services/
Service
A Kubernetes Service (SVC) is an abstraction which defines a logical set of
Pods and a policy by which to access them - sometimes called a micro-service.
http://kubernetes.io/docs/user-guide/services/
# kubectl create -f web-frontend-svc.yaml
You have exposed your service on an external port on all nodes
in your cluster. If you want to expose this service to the external
internet, you may need to set up firewall rules for the service
port(s) (tcp:31468) to serve traffic.
# kubectl describe svc web-frontend
Name: web-frontend
Namespace: default
Labels: <none>
Selector: role=web-frontend
Type: NodePort
IP: 10.254.101.55
Port: <unnamed> 80/TCP
NodePort: <unnamed> 31468/TCP
Endpoints: 172.16.50.3:80,172.16.82.3:80
# kubectl scale --replicas=10 rc/web-frontend
replicationcontroller "web-frontend" scaled
# kubectl describe rc web-frontend
Name: web-frontend
Namespace: default
Image(s): php:5.5-apache
Selector: role=web-frontend
Labels: role=web-frontend
Replicas: 10 current / 10 desired
Pods Status: 10 Running / 0 Waiting / 0 Succeeded / 0 Failed
Volumes:
nfs:
Type:PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: web-storage-claim
ReadOnly: true
[...]
Set a new size for a Replication Controller
http://kubernetes.io/docs/user-guide/kubectl/kubectl_scale/
Manual Scaling
HorizontalPodAutoscaler
HorizontalPodAutoscaler (HPA) allows to automatically scale the number of
pods in a replication controller, deployment or replica set based on observed
CPU utilization.
apiVersion: extensions/v1beta1
kind: HorizontalPodAutoscaler
metadata:
name: web-frontend
spec:
cpuUtilization:
targetPercentage: 50
maxReplicas: 10
minReplicas: 3
scaleRef:
kind: ReplicationController
name: web-frontend
subresource: scale
http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/
HorizontalPodAutoscaler
HorizontalPodAutoscaler (HPA) allows to automatically scale the number of
pods in a replication controller, deployment or replica set based on observed
CPU utilization.
http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/
# kubectl create -f web-frontend-hpa.yaml
horizontalpodautoscaler "web-frontend" created
# kubectl describe hpa web-frontend
Name: web-frontend
Namespace: default
Labels: <none>
CreationTimestamp: Thu, 14 Apr 2016 10:06:05 -0400
Reference: ReplicationController/web-
frontend/scale
Target CPU utilization: 50%
Current CPU utilization: <not available>
Min replicas: 3
Max replicas: 10
ReplicationController pods:2 current / 2 desired
HorizontalPodAutoscaler
What’s Next?!
GEOGRAPHICAL
DISTRIBUTION WITH
WAN-SDN
TECHNOLOGIES
INFINITE SCALING
WITH HYBRID CLOUD
Try this @home
github.com/atosatto/presentation-webscalek8s
Try this @home
github.com/atosatto/presentation-webscalek8s
VAGRANT UP
Thank you!
PurpleOcean
www.purpleocean.it
Andrea Tosatto
andrea.tosatto@purpleocean.eu
Flannel

More Related Content

What's hot

What's hot (20)

Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Head First to Container&Kubernetes
Head First to Container&KubernetesHead First to Container&Kubernetes
Head First to Container&Kubernetes
 
Deep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay NetworksDeep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay Networks
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
 
CoreOS @Codetalks Hamburg
CoreOS @Codetalks HamburgCoreOS @Codetalks Hamburg
CoreOS @Codetalks Hamburg
 
DevOps Guide to Container Networking
DevOps Guide to Container NetworkingDevOps Guide to Container Networking
DevOps Guide to Container Networking
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
 
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, DockerUnder the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
Under the Hood with Docker Swarm Mode - Drew Erny and Nishant Totla, Docker
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Kubernetes the Very Hard Way. Lisa Portland 2019
Kubernetes the Very Hard Way. Lisa Portland 2019Kubernetes the Very Hard Way. Lisa Portland 2019
Kubernetes the Very Hard Way. Lisa Portland 2019
 
Docker Network Overview and legacy "--link"
Docker Network Overview and legacy "--link"Docker Network Overview and legacy "--link"
Docker Network Overview and legacy "--link"
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting
 
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
Docker Meetup: Docker Networking 1.11, by Madhu VenugopalDocker Meetup: Docker Networking 1.11, by Madhu Venugopal
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
 
Kubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby StepsKubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby Steps
 
Installation Openstack Swift
Installation Openstack SwiftInstallation Openstack Swift
Installation Openstack Swift
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Docker networking tutorial 102
Docker networking tutorial 102Docker networking tutorial 102
Docker networking tutorial 102
 
Deeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksDeeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay Networks
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 

Viewers also liked

Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyond
KubeAcademy
 

Viewers also liked (14)

Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e JavaCome costruire una Platform As A Service con Docker, Kubernetes Go e Java
Come costruire una Platform As A Service con Docker, Kubernetes Go e Java
 
GlueCon kubernetes & container engine
GlueCon kubernetes & container engineGlueCon kubernetes & container engine
GlueCon kubernetes & container engine
 
Kube-AWS
Kube-AWSKube-AWS
Kube-AWS
 
Scaling Jenkins with Kubernetes by Ami Mahloof
Scaling Jenkins with Kubernetes by Ami MahloofScaling Jenkins with Kubernetes by Ami Mahloof
Scaling Jenkins with Kubernetes by Ami Mahloof
 
Running Production-Grade Kubernetes on AWS
Running Production-Grade Kubernetes on AWSRunning Production-Grade Kubernetes on AWS
Running Production-Grade Kubernetes on AWS
 
Kubernetes Networking - Giragadurai Vallirajan
Kubernetes Networking - Giragadurai VallirajanKubernetes Networking - Giragadurai Vallirajan
Kubernetes Networking - Giragadurai Vallirajan
 
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...
 
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
 
Container Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyondContainer Network Interface: Network Plugins for Kubernetes and beyond
Container Network Interface: Network Plugins for Kubernetes and beyond
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with Kubernetes
 
Kubernetes networking in AWS
Kubernetes networking in AWSKubernetes networking in AWS
Kubernetes networking in AWS
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes MeetupKubernetes Architecture and Introduction – Paris Kubernetes Meetup
Kubernetes Architecture and Introduction – Paris Kubernetes Meetup
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 

Similar to Web scale infrastructures with kubernetes and flannel

Drupalcamp es 2013 drupal with lxc docker and vagrant
Drupalcamp es 2013  drupal with lxc docker and vagrant Drupalcamp es 2013  drupal with lxc docker and vagrant
Drupalcamp es 2013 drupal with lxc docker and vagrant
Ricardo Amaro
 

Similar to Web scale infrastructures with kubernetes and flannel (20)

Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google CloudDrupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
Drupaljam 2017 - Deploying Drupal 8 onto Hosted Kubernetes in Google Cloud
 
Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...
Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...
Create a Varnish cluster in Kubernetes for Drupal caching - DrupalCon North A...
 
DCEU 18: Docker Container Networking
DCEU 18: Docker Container NetworkingDCEU 18: Docker Container Networking
DCEU 18: Docker Container Networking
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
 
Why you’re going to fail running java on docker!
Why you’re going to fail running java on docker!Why you’re going to fail running java on docker!
Why you’re going to fail running java on docker!
 
Gluster Contenarized Storage for Cloud Applications
Gluster Contenarized Storage for Cloud ApplicationsGluster Contenarized Storage for Cloud Applications
Gluster Contenarized Storage for Cloud Applications
 
Gluster Containerized Storage for Cloud Applications
Gluster Containerized Storage for Cloud ApplicationsGluster Containerized Storage for Cloud Applications
Gluster Containerized Storage for Cloud Applications
 
K8s best practices from the field!
K8s best practices from the field!K8s best practices from the field!
K8s best practices from the field!
 
Istio Playground
Istio PlaygroundIstio Playground
Istio Playground
 
Kubernetes - Starting with 1.2
Kubernetes  - Starting with 1.2Kubernetes  - Starting with 1.2
Kubernetes - Starting with 1.2
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
DevOps and Hybrid Applications: What You Need to Know
DevOps and Hybrid Applications: What You Need to KnowDevOps and Hybrid Applications: What You Need to Know
DevOps and Hybrid Applications: What You Need to Know
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
Drupalcamp es 2013 drupal with lxc docker and vagrant
Drupalcamp es 2013  drupal with lxc docker and vagrant Drupalcamp es 2013  drupal with lxc docker and vagrant
Drupalcamp es 2013 drupal with lxc docker and vagrant
 
The Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeThe Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud Native
 
Simplify Networking for Containers
Simplify Networking for ContainersSimplify Networking for Containers
Simplify Networking for Containers
 
Containerizing your Security Operations Center
Containerizing your Security Operations CenterContainerizing your Security Operations Center
Containerizing your Security Operations Center
 
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless OverviewOpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Web scale infrastructures with kubernetes and flannel

  • 1. WebScale infrastructures with Kubernetes and Flannel Container Day Verona 15/04/2016Andrea Tosatto andrea.tosatto@purpleocean.eu
  • 2. Outline ● Introduction to Purple Ocean ● Magento ○ The good ○ The bad ○ The ugly ● Project Picasso ○ Software Defined Overlay Networking with Flannel ○ Cluster Mangement with Kubernetes ● What’s Next ○ Geographical Distribution ○ Hybrid Cloud
  • 5. Magento “The high performance, scalable eCommerce solution for fast-growing and large businesses.” https://magento.com/products/overview
  • 6. Magento: the goods 1. Wide range of features and functionalities 2. Integrations 3. Large community 4. Open source 5. Thousands of agencies and developers 6. Enterprise edition available https://www.elementarydigital.co.uk/why-use-magento-for-ecommerce/
  • 7. Magento “Every 100ms of latency costs Amazon 1% of profit” http://radar.oreilly.com/2008/08/radar-theme-web-ops.html “Google says more searches now on mobile than on desktop” http://searchengineland.com/its-official-google-says-more- searches-now-on-mobile-than-on-desktop-220369
  • 8. Magento “Every 100ms of latency costs Amazon 1% of profit” http://radar.oreilly.com/2008/08/radar-theme-web-ops.html “Every 100ms of latency costs Amazon 1% of profit” http://radar.oreilly.com/2008/08/radar-theme-web-ops.html PERFORMANCES MATTER
  • 9. Magento: the bad Running medium-size businesses on Magento, could require a lot of caching layers and tricks.
  • 10. Magento: the bad 45k users 350k page views 50k sessions (per day) require 1x 2x + (Caching Layer) 7x 1x (LAMP Stack) = 52GB RAM 80vCPU 410GB STORAGE
  • 14. Project Picasso “Docker is an open source project to pack, ship and run any application as a lightweight container. Docker containers are both hardware-agnostic and platform-agnostic.” https://github.com/docker/docker “Flannel is a virtual network that gives a subnet to each host for use with container runtimes.” https://coreos.com/flannel/docs/latest/ “Kubernetes is an open-source system for automating deployment, operations, and scaling of containerized applications.” http://kubernetes.io/
  • 16. Kubernetes Architecture PHYSICAL INFRASTRUCTURE (MINIONS & MASTERS) OVERLAY (KUBERNETES & FLANNEL)
  • 17. Kubernetes Architecture PHYSICAL INFRASTRUCTURE (MINIONS & MASTERS) OVERLAY (KUBERNETES & FLANNEL) PODS & REPLICATIONS CONTROLLERS (APPLICATION UNITS)
  • 18. Kubernetes Architecture PHYSICAL INFRASTRUCTURE (MINIONS & MASTERS) OVERLAY (KUBERNETES & FLANNEL) SERVICES PODS & REPLICATIONS CONTROLLERS (APPLICATION UNITS)
  • 19. Kubernetes Architecture PHYSICAL INFRASTRUCTURE (MINIONS & MASTERS) OVERLAY (KUBERNETES & FLANNEL) PODS & REPLICATIONS CONTROLLERS (APPLICATION UNITS) SERVICES CLIENTS (USERS & APPLICATIONS)
  • 20. Persistent Volume A PersistentVolume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. http://kubernetes.io/docs/user-guide/persistent-volumes/ # Allocates 5GB of storage on the given NFS server apiVersion: v1 kind: PersistentVolume metadata: name: web-storage spec: capacity: storage: 5Gi accessModes: - ReadWriteMany nfs: server: kube-master-1 path: "/root/nfs"
  • 21. Persistent Volume A PersistentVolume (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. http://kubernetes.io/docs/user-guide/persistent-volumes/ # kubectl create -f web-storage-pv.yaml persistentvolume "web-storage" created # kubectl describe pv web-storage Name: web-storage Labels: <none> Status: Available Claim: Reclaim Policy: Retain Access Modes: RWX Capacity: 5Gi Message: Source: Type: NFS (an NFS mount that lasts the lifetime of a pod) Server: kube-master-1 Path: /root/nfs ReadOnly: false
  • 22. Persistent Volume Claim A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a pod. Pods consume node resources and PVCs consume PV resources. # This PersistentVolumeClaim claims 5GB of storage # for the web-application. apiVersion: v1 kind: PersistentVolumeClaim metadata: name: web-storage-claim spec: accessModes: - ReadWriteMany resources: requests: storage: 5Gi http://kubernetes.io/docs/user-guide/persistent-volumes/
  • 23. Persistent Volume Claim A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a pod. Pods consume node resources and PVCs consume PV resources. # kubectl create -f web-storage-pvc.yaml persistentvolumeclaim "web-storage-claim" created http://kubernetes.io/docs/user-guide/persistent-volumes/ # kubectl describe pvc web-storage Name: web-storage-claim Namespace: default Status: Bound Volume: web-storage Labels: <none> Capacity: 5Gi Access Modes: RWX
  • 24. Pod & ReplicationController A ReplicationController (RC) ensures that a specified number of pod “replicas” are running at any one time. In other words, a replication controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the replication controller will start more http://kubernetes.io/docs/user-guide/replication-controller/ apiVersion: v1 kind: ReplicationController metadata: name: web-frontend spec: replicas: 2 selector: role: web-frontend template: metadata: labels: role: web-frontend spec: containers: - name: web-frontend image: php:5.5-apache ports: - name: web containerPort: 80 volumeMounts: - name: nfs mountPath: "/var/www/html" volumes: - name: nfs persistentVolumeClaim: claimName: web-storage-claim
  • 25. # kubectl create -f web-frontend-rc.yaml replicationcontroller "web-frontend" created # kubectl describe rc web-frontend Name: web-frontend Namespace: default Image(s): php:5.5-apache Selector: role=web-frontend Labels: role=web-frontend Replicas: 2 current / 2 desired Pods Status: 2 Running / 0 Waiting / 0 Succeeded / 0 Failed Volumes: nfs: Type:PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) ClaimName: web-storage-claim ReadOnly: true [...] Pod & ReplicationController A ReplicationController (RC) ensures that a specified number of pod “replicas” are running at any one time. In other words, a replication controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the replication controller will start more http://kubernetes.io/docs/user-guide/replication-controller/
  • 26. # Expose the web-frontend on each Minion apiVersion: v1 kind: Service metadata: name: web-frontend spec: ports: - port: 80 type: NodePort selector: role: web-frontend Service A Kubernetes Service (SVC) is an abstraction which defines a logical set of Pods and a policy by which to access them - sometimes called a micro-service. http://kubernetes.io/docs/user-guide/services/
  • 27. Service A Kubernetes Service (SVC) is an abstraction which defines a logical set of Pods and a policy by which to access them - sometimes called a micro-service. http://kubernetes.io/docs/user-guide/services/ # kubectl create -f web-frontend-svc.yaml You have exposed your service on an external port on all nodes in your cluster. If you want to expose this service to the external internet, you may need to set up firewall rules for the service port(s) (tcp:31468) to serve traffic. # kubectl describe svc web-frontend Name: web-frontend Namespace: default Labels: <none> Selector: role=web-frontend Type: NodePort IP: 10.254.101.55 Port: <unnamed> 80/TCP NodePort: <unnamed> 31468/TCP Endpoints: 172.16.50.3:80,172.16.82.3:80
  • 28. # kubectl scale --replicas=10 rc/web-frontend replicationcontroller "web-frontend" scaled # kubectl describe rc web-frontend Name: web-frontend Namespace: default Image(s): php:5.5-apache Selector: role=web-frontend Labels: role=web-frontend Replicas: 10 current / 10 desired Pods Status: 10 Running / 0 Waiting / 0 Succeeded / 0 Failed Volumes: nfs: Type:PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) ClaimName: web-storage-claim ReadOnly: true [...] Set a new size for a Replication Controller http://kubernetes.io/docs/user-guide/kubectl/kubectl_scale/ Manual Scaling
  • 29. HorizontalPodAutoscaler HorizontalPodAutoscaler (HPA) allows to automatically scale the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. apiVersion: extensions/v1beta1 kind: HorizontalPodAutoscaler metadata: name: web-frontend spec: cpuUtilization: targetPercentage: 50 maxReplicas: 10 minReplicas: 3 scaleRef: kind: ReplicationController name: web-frontend subresource: scale http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/
  • 30. HorizontalPodAutoscaler HorizontalPodAutoscaler (HPA) allows to automatically scale the number of pods in a replication controller, deployment or replica set based on observed CPU utilization. http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/ # kubectl create -f web-frontend-hpa.yaml horizontalpodautoscaler "web-frontend" created # kubectl describe hpa web-frontend Name: web-frontend Namespace: default Labels: <none> CreationTimestamp: Thu, 14 Apr 2016 10:06:05 -0400 Reference: ReplicationController/web- frontend/scale Target CPU utilization: 50% Current CPU utilization: <not available> Min replicas: 3 Max replicas: 10 ReplicationController pods:2 current / 2 desired