SlideShare ist ein Scribd-Unternehmen logo
1 von 68
Downloaden Sie, um offline zu lesen
Microservices
and
Deploying Methodologies
1
26th April, 2019
Microservices over Monolithic
Kubernetes for Deployment
Deploying of Microservices in local Environment
Deploying of Microservices over GCP
Overview of Kubernetes
(Anil Chauhan)
(Anil Chauhan)
(Rahul Abrol)
(Sapna Upreti)
(Sapna Upreti)
Anil Kumar Chauhan, Head of Engineering - Successive Technologies
About Me
anil.chauhan@successive.tech
facebook.com/anil.livelife
www.linkedin.com/in/anilkchauhan/
❖ 10+ Years of IT Experience
❖ Technical Architect and Trainer
❖ Worked as full stack developer on numerous web
technologies
❖ Proficient on Cloud Agnostic Platform
twitter.com/anillivelife
Enterprise Application - Checklist
Use of emerging technologiesTeam must own the code
Easy to understand and
enhance
Productive new members
Scalability and availability
Support to continuous
deployment
Main Components:
Monolithic Applications
Traditional way to build enterprise app, and deployed and scaled as a single package
● Client-side user interface
● Server-side application
○ Design Pattern(Services & Repositories)
● A database server
Monolithic Application
Services
Repositories
Scaling and deployed
as a single package
Business Layer
Data Store
User Interface
Monolithic Application: Example
Products
- product_id
- product_name
- product_price
- market_id
Users
- user_id
- user_name
- market_id
Markets
- market_id
- market_name
A query to get the list of products and market name of the logged in
user say with id=40 under price 300?
SELECT product_name, market_name
FROM products
INNER JOIN markets on products.maket_id = markets.id
INNER JOIN users on users.market_id = markets.id
WHERE users.user_id = 40
AND products.product_price < 300
Monolithic Application - MVP version
Dev Team 1
What if a big hit?
Monolithic Application - After few releases
Dev Team 1
Dev Team 2
Dev Team 3
Dev Team 4
Areas where multiple teams
working on same part
Monolithic - Pros / Cons
Not ideal for growing codebase.
Barrier to adopting new technologies
Steep learning curve
Simple to develop, for small codebases
Simple to Test
Simple to deploy and scale Pros
&
Cons
Slower release for large code base
IDE-friendly
Checklist - Revisit
Use of emerging
technologies
Team must own the
code
Easy to understand and
enhance
Productive new
members
Scalability and
availability
Support to continuous
deployment
Design Considerations
Micro Services
Suites of independently deployable services
● Organized around business capability
● Decentralized Database
● Loosely Coupled and Highly Cohesive
● Independently deployed
Microservice Application
Users Service
Market Service
Products
Service
API Gateway
Events
2 Replica
1 Replica
Microservice Application: Example
products
{
id: 1,
name: ‘AWS’
price: 300,
market: {
id: 1,
name: US
}
}
Users
{
id: 1,
name: ‘John Smith’
market: {
id: 1,
name: US
}
}
markets
{
id: 1,
name: US,
currency: ‘$’,
created_at: ‘123’,
updated_at: ‘abc’
}
● Separate database per service as per business domain
● Maintain Duplicacy of data with single source of truth
● Eventual Consistency among services
Microservice - Pros / Cons
More moving parts
Documentation overhead
Complex infrastructure
Better for complex application
High scalability
Ease of deployment Pros
&
Cons
Harder to Debugging
Easy to understand
Checklist - Revisit
Use of emerging
technologies
Team must own the
code
Easy to understand and
enhance
Productive new
members
Scalability and
availability
Support to continuous
deployment
Comparison (Productivity vs Complexity)
Productivity
Complexity
For less complex app managing
microservices will leads to extra
efforts.
Decoupling nature of
microservices really pay off.
Microservice
Monolithic
Deployment Challenges with Microservices
Deployment and configuration of
high number of services
Monitoring of services for node
failures
Scaling of particular services and
distribution of traffic
Service Logs and Debugging
Update strategy with zero downtime
Rollback in case of any trouble
● Invented by Google
● Managed by open source community
● Adopted by Microsoft and Amazon
● Run Anywhere
Why to Choose?
Kubernetes (K8s)
An open-source system for automating deployment, scaling, and management of
containerized apps
Overview of K8s
20
(Rahul Abrol)
Rahul Abrol, DevOps Engineer - Successive Technologies
About Me
rahul.abrol@successive.tech
facebook.com/rahul.abrol.96
www.linkedin.com/in/rahul-abrol-002042ab
❖ 3+ Years of IT Experience
❖ Site Reliability Engineer and Automation Expert
❖ Delivered Solutions for various Projects
twitter.com/RahulAb75631000
Basic components of Kubernetes (Cloud)
Cluster
CLI
Kubectl
Master Node
API Server
Scheduler
Controller Manager
etcd
Worker Node 1
kubelet kube-proxy
docker
Pod 1 Pod 2 Pod N
Worker Node N
kubelet kube-proxy
docker
Pod 1 Pod 2 Pod N
UI
Dashboard
Basic components of Kubernetes (local)
CLI
Kubectl
Minikube
Master Node
Single Worker Node
kubelet kube-proxy
docker
Pod 1 Pod 2 Pod N
Local Cluster
UI
Dashboard
Basic components: Pods
Worker Node
kubelet kube-proxy
docker
Pod 1 Pod 2 Pod N
Containers
● Basic and smallest building block.
● All the connected containers
deployed to a single pod
● Containers inside pod will live and
die together
● All containers have common IP,
and resources.
● Each POD has unique IP.
User
Log
Product Report
Log
Basic components: Deployments
● Scaling up and down of the pods.
● Manages releases and rollback
● Self Healing of system
● Assign a unique label to every set
of pods, and used by services for
discovery.
Deployment
Replica Set
Replica: 2
Pod Pod
User User
Log Log
label=user-service label=user-service
Basic components: Service
● Stable endpoint that load
balances traffic among pods with
similar label
● Discover the respective pods by
the selectors
● With Service you don’t have to
remember how many pods are
running or where
Deployment
Replica Set
Replica: 2
Pod Pod
label=user-service label=user-service
Service
selector: user-service
Basic components: Ingress
Service: user-service
Type: NodePort
Service: market-service
Type: NodePort
Service: product-service
Type: NodePort
Pod A
label: user-service
Pod B
label: user-service
Pod C
label: market-service
Pod D
label: product-service
Pod E
label: product-service
Pod Ingress
Controller
Service: ingress
Type: LoadBalancer
Public IP
-Path: /users
Service: user-service
-Path: /markets
Service: market-service
-Path: /products
Service: product-service
Deployment on GCP
28
(Sapna Upreti)
Sapna Upreti, Sr. Software Engineer - Successive Technologies
About Me
sapna.upreti@successive.tech
facebook.com/sapna0214
www.linkedin.com/in/sapna-upreti-a093525b/
❖ 4+ Years of IT Experience
❖ Technology Specialist
❖ Blogger
❖ Tech Speaker
https://twitter.com/sapna0214
GKE: Prerequisites
● gcloud CLI
● Enabled the Google
Kubernetes Engine API
● gloud init
GKE: Create Cluster
GKE: Create k8s Cluster
gcloud container clusters get-credentials NAME [--internal-ip] [--region=REGION | --zone=ZONE, -z
ZONE] [GCLOUD_WIDE_FLAG …]
GKE: in action
33
K8s: Rollbacks
● Rolling out your application to
previous version
● Set the revision that you want
● Kubernetes will scale up the
corresponding ReplicaSet, and
scaled down the current one
Handy Commands:
● kubectl rollout history deployments products
● kubectl rollout status deployments products
● kubectl rollout undo deployments products
K8s: Rollbacks in action
36
Deployment Strategies: Rolling Updates
● Replace each pod in the deployment with a new one
● Backwards compatibility
● New ReplicaSet created and old ones gets decreased
V1
V1
V1
V1
V1
V1
V2
V1
V1
V1
V1
V2
V2
V2
V2
V2
V2
V2` ` ` `
Deployment Strategies: Rolling Updates (example)
Deployment Strategies: Recreate Strategy
Terminate the old version and release the new one
V1
V1
V1
V1
V1
V1
V1
V1
V2
V2
V2
V2` ` `
Deployment Strategies: Blue/Green
● Run two complete deployments of your application
● “green” version of the application is deployed alongside the “blue”
version
V1
V1
V1
V1
V2
V2
V1
V1
V2
V2
V2
V2
Deployment Strategies: Blue/Green (example)
Deployment Strategies in
action
43
Deployment on Local
45
(Sapna Upreti)
Minikube: K8s cluster on Local
UI
CLI
Kubectl
Minikube
Master Node
API
Server
Scheduler
Controller
Manager
etcd
Single Node
kubelet kube-proxy
docker
Pod 1 Pod 2 Pod N
Local Cluster
Dashboard
Minikube: Prerequisites
Few handy commands:
● minikube start (pass VM option),
default is VirtualBox
● minikube addons enable ingress
● VM Driver
○ macOS: VirtualBox, VMware
Fusion, HyperKit
○ Linux: VirtualBox, KVM
○ Windows: VirtualBox, Hyper-V
● Install Minikube
○ brew cask install minikube
(macOS)
● Install kubectl
● VT-x/AMD-v virtualization
must be enabled in BIOS
● Internet connection on first run
Minikube: K8s Cluster
Hurrah! Now we have K8s cluster
running named as minikube
● kubectl config get-contexts
Minikube: K8s Cluster
Change context to minikube
● kubectl config use-context
minikube
● kubectl config get-contexts
Minikube: Deployment
Deployments are requirements you give to Kubernetes regarding your applications
(your Pods)
“Hey Kube, always keep 5 instances (or replicas) of these Pods running — always”
Minikube: Deployment (Markets Service)
Container Port is the port that the
application is running on.
Readiness probes: when a Container
is ready to start accepting traffic.
A Pod is considered ready when all of
its Containers are ready
Minikube: Deployment (Products Service)
● A Deployment named
demo-product is created
● four replicated Pods
● Pods are labeled as
demo-products
● Image from docker
● Environment variables
Minikube: Deployment (Users Service)
● A Deployment named demo-users
is created
● Two replicated Pods
● Pods are labeled as demo-users
● Image from docker
● Environment variables
Minikube: Service
Expose our pods using Services.
“Not healthy? Killed.
Not in the right place? Cloned, and killed.”
Minikube: Service (Markets Service)
Each Pod has a unique IP address,
those IPs are not exposed outside the
cluster without a Service
demo-markets service
Selects demo-markets Pods
Minikube: Service (Products Service)
Each Pod has a unique IP address,
those IPs are not exposed outside the
cluster without a Service
demo-products service
Selects demo-products Pods
Minikube: Service (Users Service)
Each Pod has a unique IP address,
those IPs are not exposed outside the
cluster without a Service
demo-users service
Selects demo-users Pod
Minikube: Ingress
Ingress objects are the rules
that define the routes that
should exist.
Annotations to configure some
options depending on the
Ingress controller
Target URI where the traffic
must be redirected
Minikube- in action
59
Minikube: UI Deployment and Service
Minikube: Dashboard (minikube dashboard)
Minikube- in action (UI)
63
Tools and Clouds
65
Clouds and Tools
We at Successive Technologies use following tools for building Cloud Agnostic Platform.
Queries?
Thank You

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

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 ...
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes Architecture
 
MicroServices with Containers, Kubernetes & ServiceMesh
MicroServices with Containers, Kubernetes & ServiceMeshMicroServices with Containers, Kubernetes & ServiceMesh
MicroServices with Containers, Kubernetes & ServiceMesh
 
Best Practices with Azure Kubernetes Services
Best Practices with Azure Kubernetes ServicesBest Practices with Azure Kubernetes Services
Best Practices with Azure Kubernetes Services
 
모두의 쿠버네티스 (Kubernetes for everyone)
모두의 쿠버네티스 (Kubernetes for everyone)모두의 쿠버네티스 (Kubernetes for everyone)
모두의 쿠버네티스 (Kubernetes for everyone)
 
Integration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices ArchitecturesIntegration Patterns and Anti-Patterns for Microservices Architectures
Integration Patterns and Anti-Patterns for Microservices Architectures
 
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
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Deploying your first application with Kubernetes
Deploying your first application with KubernetesDeploying your first application with Kubernetes
Deploying your first application with Kubernetes
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Monitoring in Azure
Monitoring in AzureMonitoring in Azure
Monitoring in Azure
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep dive
 
Openshift Container Platform
Openshift Container PlatformOpenshift Container Platform
Openshift Container Platform
 
Azure DevOps
Azure DevOpsAzure DevOps
Azure DevOps
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overview
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
 

Ähnlich wie Devops - Microservice and Kubernetes

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
 

Ähnlich wie Devops - Microservice and Kubernetes (20)

Microservices and Deployment Methodologies
Microservices and Deployment MethodologiesMicroservices and Deployment Methodologies
Microservices and Deployment Methodologies
 
Pivotal Container Service Overview
Pivotal Container Service Overview Pivotal Container Service Overview
Pivotal Container Service Overview
 
Pivotal Platform: A First Look at the October Release
Pivotal Platform: A First Look at the October ReleasePivotal Platform: A First Look at the October Release
Pivotal Platform: A First Look at the October Release
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
 
Kubernetes deep dive - - Huawei 2015-10
Kubernetes deep dive - - Huawei 2015-10Kubernetes deep dive - - Huawei 2015-10
Kubernetes deep dive - - Huawei 2015-10
 
03-03-2023 - APIForce (1).pdf
03-03-2023 - APIForce (1).pdf03-03-2023 - APIForce (1).pdf
03-03-2023 - APIForce (1).pdf
 
8 - OpenShift - A look at a container platform: what's in the box
8 - OpenShift - A look at a container platform: what's in the box8 - OpenShift - A look at a container platform: what's in the box
8 - OpenShift - A look at a container platform: what's in the box
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
 
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
 
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with KubernetesSumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
 
Pivotal Container Service (PKS) at SF Cloud Foundry Meetup
Pivotal Container Service (PKS) at SF Cloud Foundry MeetupPivotal Container Service (PKS) at SF Cloud Foundry Meetup
Pivotal Container Service (PKS) at SF Cloud Foundry Meetup
 
AWS Community Day - Amy Negrette - Gateways to Gateways
AWS Community Day - Amy Negrette - Gateways to GatewaysAWS Community Day - Amy Negrette - Gateways to Gateways
AWS Community Day - Amy Negrette - Gateways to Gateways
 
Technology insights: Decision Science Platform
Technology insights: Decision Science PlatformTechnology insights: Decision Science Platform
Technology insights: Decision Science Platform
 
Automating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native MeetupAutomating Applications with Habitat - Sydney Cloud Native Meetup
Automating Applications with Habitat - Sydney Cloud Native Meetup
 
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
OSDC 2018 | From Monolith to Microservices by Paul Puschmann_
 
Continuous API Strategies for Integrated Platforms
 Continuous API Strategies for Integrated Platforms Continuous API Strategies for Integrated Platforms
Continuous API Strategies for Integrated Platforms
 
Intro Docker to Loire Atlantique
Intro Docker to Loire AtlantiqueIntro Docker to Loire Atlantique
Intro Docker to Loire Atlantique
 
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)
 
Docker Roadshow 2016
Docker Roadshow 2016Docker Roadshow 2016
Docker Roadshow 2016
 

Mehr von NodeXperts

Mehr von NodeXperts (20)

ECMA Script
ECMA ScriptECMA Script
ECMA Script
 
Apollo Server IV
Apollo Server IVApollo Server IV
Apollo Server IV
 
React Context API
React Context APIReact Context API
React Context API
 
Introduction to EC2 (AWS)
Introduction to EC2 (AWS)Introduction to EC2 (AWS)
Introduction to EC2 (AWS)
 
Reactive Application Using METEOR
Reactive Application Using METEORReactive Application Using METEOR
Reactive Application Using METEOR
 
Apollo server II
Apollo server IIApollo server II
Apollo server II
 
Apollo Server
Apollo ServerApollo Server
Apollo Server
 
Apollo Server III
Apollo Server IIIApollo Server III
Apollo Server III
 
Getting Reactive Data
Getting Reactive DataGetting Reactive Data
Getting Reactive Data
 
State, Life cycle, Methods & Events
State, Life cycle, Methods & Events State, Life cycle, Methods & Events
State, Life cycle, Methods & Events
 
Refs in react
Refs in reactRefs in react
Refs in react
 
Flow router, components and props
Flow router, components and propsFlow router, components and props
Flow router, components and props
 
Using react with meteor
Using react with meteorUsing react with meteor
Using react with meteor
 
Introduction to Reactjs
Introduction to ReactjsIntroduction to Reactjs
Introduction to Reactjs
 
Mobile apps using meteor - Part 1
Mobile apps using meteor - Part 1Mobile apps using meteor - Part 1
Mobile apps using meteor - Part 1
 
Microservice architecture : Part 1
Microservice architecture : Part 1Microservice architecture : Part 1
Microservice architecture : Part 1
 
Reactive web applications using MeteorJS
Reactive web applications using MeteorJSReactive web applications using MeteorJS
Reactive web applications using MeteorJS
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
Meteor workshop
Meteor workshopMeteor workshop
Meteor workshop
 
Introduction to meteor
Introduction to meteorIntroduction to meteor
Introduction to meteor
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Devops - Microservice and Kubernetes

  • 2. Microservices over Monolithic Kubernetes for Deployment Deploying of Microservices in local Environment Deploying of Microservices over GCP Overview of Kubernetes (Anil Chauhan) (Anil Chauhan) (Rahul Abrol) (Sapna Upreti) (Sapna Upreti)
  • 3. Anil Kumar Chauhan, Head of Engineering - Successive Technologies About Me anil.chauhan@successive.tech facebook.com/anil.livelife www.linkedin.com/in/anilkchauhan/ ❖ 10+ Years of IT Experience ❖ Technical Architect and Trainer ❖ Worked as full stack developer on numerous web technologies ❖ Proficient on Cloud Agnostic Platform twitter.com/anillivelife
  • 4. Enterprise Application - Checklist Use of emerging technologiesTeam must own the code Easy to understand and enhance Productive new members Scalability and availability Support to continuous deployment
  • 5. Main Components: Monolithic Applications Traditional way to build enterprise app, and deployed and scaled as a single package ● Client-side user interface ● Server-side application ○ Design Pattern(Services & Repositories) ● A database server
  • 6. Monolithic Application Services Repositories Scaling and deployed as a single package Business Layer Data Store User Interface
  • 7. Monolithic Application: Example Products - product_id - product_name - product_price - market_id Users - user_id - user_name - market_id Markets - market_id - market_name A query to get the list of products and market name of the logged in user say with id=40 under price 300? SELECT product_name, market_name FROM products INNER JOIN markets on products.maket_id = markets.id INNER JOIN users on users.market_id = markets.id WHERE users.user_id = 40 AND products.product_price < 300
  • 8. Monolithic Application - MVP version Dev Team 1 What if a big hit?
  • 9. Monolithic Application - After few releases Dev Team 1 Dev Team 2 Dev Team 3 Dev Team 4 Areas where multiple teams working on same part
  • 10. Monolithic - Pros / Cons Not ideal for growing codebase. Barrier to adopting new technologies Steep learning curve Simple to develop, for small codebases Simple to Test Simple to deploy and scale Pros & Cons Slower release for large code base IDE-friendly
  • 11. Checklist - Revisit Use of emerging technologies Team must own the code Easy to understand and enhance Productive new members Scalability and availability Support to continuous deployment
  • 12. Design Considerations Micro Services Suites of independently deployable services ● Organized around business capability ● Decentralized Database ● Loosely Coupled and Highly Cohesive ● Independently deployed
  • 13. Microservice Application Users Service Market Service Products Service API Gateway Events 2 Replica 1 Replica
  • 14. Microservice Application: Example products { id: 1, name: ‘AWS’ price: 300, market: { id: 1, name: US } } Users { id: 1, name: ‘John Smith’ market: { id: 1, name: US } } markets { id: 1, name: US, currency: ‘$’, created_at: ‘123’, updated_at: ‘abc’ } ● Separate database per service as per business domain ● Maintain Duplicacy of data with single source of truth ● Eventual Consistency among services
  • 15. Microservice - Pros / Cons More moving parts Documentation overhead Complex infrastructure Better for complex application High scalability Ease of deployment Pros & Cons Harder to Debugging Easy to understand
  • 16. Checklist - Revisit Use of emerging technologies Team must own the code Easy to understand and enhance Productive new members Scalability and availability Support to continuous deployment
  • 17. Comparison (Productivity vs Complexity) Productivity Complexity For less complex app managing microservices will leads to extra efforts. Decoupling nature of microservices really pay off. Microservice Monolithic
  • 18. Deployment Challenges with Microservices Deployment and configuration of high number of services Monitoring of services for node failures Scaling of particular services and distribution of traffic Service Logs and Debugging Update strategy with zero downtime Rollback in case of any trouble
  • 19. ● Invented by Google ● Managed by open source community ● Adopted by Microsoft and Amazon ● Run Anywhere Why to Choose? Kubernetes (K8s) An open-source system for automating deployment, scaling, and management of containerized apps
  • 21. Rahul Abrol, DevOps Engineer - Successive Technologies About Me rahul.abrol@successive.tech facebook.com/rahul.abrol.96 www.linkedin.com/in/rahul-abrol-002042ab ❖ 3+ Years of IT Experience ❖ Site Reliability Engineer and Automation Expert ❖ Delivered Solutions for various Projects twitter.com/RahulAb75631000
  • 22. Basic components of Kubernetes (Cloud) Cluster CLI Kubectl Master Node API Server Scheduler Controller Manager etcd Worker Node 1 kubelet kube-proxy docker Pod 1 Pod 2 Pod N Worker Node N kubelet kube-proxy docker Pod 1 Pod 2 Pod N UI Dashboard
  • 23. Basic components of Kubernetes (local) CLI Kubectl Minikube Master Node Single Worker Node kubelet kube-proxy docker Pod 1 Pod 2 Pod N Local Cluster UI Dashboard
  • 24. Basic components: Pods Worker Node kubelet kube-proxy docker Pod 1 Pod 2 Pod N Containers ● Basic and smallest building block. ● All the connected containers deployed to a single pod ● Containers inside pod will live and die together ● All containers have common IP, and resources. ● Each POD has unique IP. User Log Product Report Log
  • 25. Basic components: Deployments ● Scaling up and down of the pods. ● Manages releases and rollback ● Self Healing of system ● Assign a unique label to every set of pods, and used by services for discovery. Deployment Replica Set Replica: 2 Pod Pod User User Log Log label=user-service label=user-service
  • 26. Basic components: Service ● Stable endpoint that load balances traffic among pods with similar label ● Discover the respective pods by the selectors ● With Service you don’t have to remember how many pods are running or where Deployment Replica Set Replica: 2 Pod Pod label=user-service label=user-service Service selector: user-service
  • 27. Basic components: Ingress Service: user-service Type: NodePort Service: market-service Type: NodePort Service: product-service Type: NodePort Pod A label: user-service Pod B label: user-service Pod C label: market-service Pod D label: product-service Pod E label: product-service Pod Ingress Controller Service: ingress Type: LoadBalancer Public IP -Path: /users Service: user-service -Path: /markets Service: market-service -Path: /products Service: product-service
  • 29. Sapna Upreti, Sr. Software Engineer - Successive Technologies About Me sapna.upreti@successive.tech facebook.com/sapna0214 www.linkedin.com/in/sapna-upreti-a093525b/ ❖ 4+ Years of IT Experience ❖ Technology Specialist ❖ Blogger ❖ Tech Speaker https://twitter.com/sapna0214
  • 30. GKE: Prerequisites ● gcloud CLI ● Enabled the Google Kubernetes Engine API ● gloud init
  • 32. GKE: Create k8s Cluster gcloud container clusters get-credentials NAME [--internal-ip] [--region=REGION | --zone=ZONE, -z ZONE] [GCLOUD_WIDE_FLAG …]
  • 34.
  • 35. K8s: Rollbacks ● Rolling out your application to previous version ● Set the revision that you want ● Kubernetes will scale up the corresponding ReplicaSet, and scaled down the current one Handy Commands: ● kubectl rollout history deployments products ● kubectl rollout status deployments products ● kubectl rollout undo deployments products
  • 36. K8s: Rollbacks in action 36
  • 37.
  • 38. Deployment Strategies: Rolling Updates ● Replace each pod in the deployment with a new one ● Backwards compatibility ● New ReplicaSet created and old ones gets decreased V1 V1 V1 V1 V1 V1 V2 V1 V1 V1 V1 V2 V2 V2 V2 V2 V2 V2` ` ` `
  • 39. Deployment Strategies: Rolling Updates (example)
  • 40. Deployment Strategies: Recreate Strategy Terminate the old version and release the new one V1 V1 V1 V1 V1 V1 V1 V1 V2 V2 V2 V2` ` `
  • 41. Deployment Strategies: Blue/Green ● Run two complete deployments of your application ● “green” version of the application is deployed alongside the “blue” version V1 V1 V1 V1 V2 V2 V1 V1 V2 V2 V2 V2
  • 44.
  • 46. Minikube: K8s cluster on Local UI CLI Kubectl Minikube Master Node API Server Scheduler Controller Manager etcd Single Node kubelet kube-proxy docker Pod 1 Pod 2 Pod N Local Cluster Dashboard
  • 47. Minikube: Prerequisites Few handy commands: ● minikube start (pass VM option), default is VirtualBox ● minikube addons enable ingress ● VM Driver ○ macOS: VirtualBox, VMware Fusion, HyperKit ○ Linux: VirtualBox, KVM ○ Windows: VirtualBox, Hyper-V ● Install Minikube ○ brew cask install minikube (macOS) ● Install kubectl ● VT-x/AMD-v virtualization must be enabled in BIOS ● Internet connection on first run
  • 48. Minikube: K8s Cluster Hurrah! Now we have K8s cluster running named as minikube ● kubectl config get-contexts
  • 49. Minikube: K8s Cluster Change context to minikube ● kubectl config use-context minikube ● kubectl config get-contexts
  • 50. Minikube: Deployment Deployments are requirements you give to Kubernetes regarding your applications (your Pods) “Hey Kube, always keep 5 instances (or replicas) of these Pods running — always”
  • 51. Minikube: Deployment (Markets Service) Container Port is the port that the application is running on. Readiness probes: when a Container is ready to start accepting traffic. A Pod is considered ready when all of its Containers are ready
  • 52. Minikube: Deployment (Products Service) ● A Deployment named demo-product is created ● four replicated Pods ● Pods are labeled as demo-products ● Image from docker ● Environment variables
  • 53. Minikube: Deployment (Users Service) ● A Deployment named demo-users is created ● Two replicated Pods ● Pods are labeled as demo-users ● Image from docker ● Environment variables
  • 54. Minikube: Service Expose our pods using Services. “Not healthy? Killed. Not in the right place? Cloned, and killed.”
  • 55. Minikube: Service (Markets Service) Each Pod has a unique IP address, those IPs are not exposed outside the cluster without a Service demo-markets service Selects demo-markets Pods
  • 56. Minikube: Service (Products Service) Each Pod has a unique IP address, those IPs are not exposed outside the cluster without a Service demo-products service Selects demo-products Pods
  • 57. Minikube: Service (Users Service) Each Pod has a unique IP address, those IPs are not exposed outside the cluster without a Service demo-users service Selects demo-users Pod
  • 58. Minikube: Ingress Ingress objects are the rules that define the routes that should exist. Annotations to configure some options depending on the Ingress controller Target URI where the traffic must be redirected
  • 60.
  • 61. Minikube: UI Deployment and Service
  • 64.
  • 66. Clouds and Tools We at Successive Technologies use following tools for building Cloud Agnostic Platform.