Breaking the Monolith to
Microservices with Docker and
Kubernetes
2
Tamir Dresher
@tamir_dresher
Cloud Division Leader
tamirdr@codevalue.net
Haim Kabesa
@haimkabesa
DevOps Division Leader
haimk@codevalue.net
3
ModularityThe degree to which a system's components may be separated and rec
(https://en.wikipedia.org/wiki/Modularity(
Software Architecture is like Pasta
4By @benorama
Agenda
From Monolith to Microservices
How can Docker help us?
Orchestrating microservices with Kubernetes
Taking your microservices to the next level
5
The Monolith
6
User Management
Controllers
BL
Data Access
Media
Controllers
BL
Data Access
Survey
Controllers
BL
Data Access
• Large
• Deployment
• Scaling
• Single Storage
(usually)
• Single
Technology
• Simple
• Easy testing
• Fast
communication
• Single Storage
• Easy debugging
Breaking The Monolith
7
User Management
Controllers
BL
Data Access
Media
Controllers
BL
Data Access
Survey
Controllers
BL
Data Access
Breaking The Monolith
8
Survey
Controllers
BL
Data Access
User Management
Controllers
BL
Data Access
Media
Controllers
BL
Data Access
Just The Right Number Of Modules
9
number of modules
Module
integration cost
module development cost
The cost of
the software
What is a Microservice
A distributed unit of responsibility (logic & state) that is
independently versioned, deployed, and scaled
Interacts with other microservices over well defined interfaces and
protocols like REST or Queue-Based Messaging
10
Deployment
Service Discovery
Scaling
Security
Managing configuration
Health & Readiness checks
Logging
Load balancing
Data Persistency
Microservices Challenges
12
Docker Kuberenetes
Not the only game in town, but certainly the loudest
Docker
Kubernete
s
Sealed application software.
A container image is a lightweight, stand-alone, executable package of
a piece of software that includes everything needed to run it: code,
runtime, system tools, system libraries, settings.
What is a container image?
/
etc dev lib proc
rpc ssh systemdudev
Hypervisor Architecture
Free space
Host OS
Server
VM
OS
App
VM
OS
App
VM
OS
App App
VM
OS
Hypervisor
Server
Container
Host OS
Docker Engine
App App App App
Docker is agnostic to the infrastructure layer
As a runtime docker provide access to devices, file system, privileges, variables, functions, API etc.
App
Docker Engine
App
Dev Machine
App
Docker Engine
App App
Docker Engine
App
Lift and
shift
The development cycle
17
Build
Container Registry
Binaries
Configuration
Dependencies
Image Container
Dockerfile
FROM microsoft/dotnet:2.0-runtime
WORKDIR /app
COPY /app .
ENTRYPOINT ["dotnet", "Voting.Processor.dll"]
Developer
Demo
Containers in action
18
Taking Tabs vs. Spaces to the extreme
19
Web
(python)
API
(ASP.NET Core)
Redis
Worker
(.NET Core Console)
RabbitMQ
Kuberenetes
An orchestrator that manages the containers environment
20
MonitorMonitor
Node(s)
Pod containercontainer
Deployment
• Configurations
• Secrets
• Services (discovery)
• …
Demo
Kubernetes Cluster
21
Autoscale
Limits:
Example:
if CPU utilization exceeds 50%, the autoscaler increases the pods to a
maximum of 10
22
resources:
requests:
cpu: 250m
limits:
cpu: 500m
kubectl autoscale deployment azure-vote-front --cpu-percent=50 --min=3 --max=10
Doing It Right
Architect
Modularity
Low Coupling, High Cohesion
Schema/API Versioning
DevOps
CI/CD
Automation
Monitor and Act
Testing in production
Load and Chaos
23
Summary
From Monolith to Microservices
How can Docker help us?
Orchestrating microservices with Kubernetes
Taking your microservices to the next level
24
Thank You!
25
Tamir Dresher
@tamir_dresher
Cloud Division Leader
tamirdr@codevalue.net
http://tamirdresher.com

Breaking the monolith to microservice with Docker and Kubernetes (k8s)

  • 2.
    Breaking the Monolithto Microservices with Docker and Kubernetes 2 Tamir Dresher @tamir_dresher Cloud Division Leader tamirdr@codevalue.net Haim Kabesa @haimkabesa DevOps Division Leader haimk@codevalue.net
  • 3.
    3 ModularityThe degree towhich a system's components may be separated and rec (https://en.wikipedia.org/wiki/Modularity(
  • 4.
    Software Architecture islike Pasta 4By @benorama
  • 5.
    Agenda From Monolith toMicroservices How can Docker help us? Orchestrating microservices with Kubernetes Taking your microservices to the next level 5
  • 6.
    The Monolith 6 User Management Controllers BL DataAccess Media Controllers BL Data Access Survey Controllers BL Data Access • Large • Deployment • Scaling • Single Storage (usually) • Single Technology • Simple • Easy testing • Fast communication • Single Storage • Easy debugging
  • 7.
    Breaking The Monolith 7 UserManagement Controllers BL Data Access Media Controllers BL Data Access Survey Controllers BL Data Access
  • 8.
    Breaking The Monolith 8 Survey Controllers BL DataAccess User Management Controllers BL Data Access Media Controllers BL Data Access
  • 9.
    Just The RightNumber Of Modules 9 number of modules Module integration cost module development cost The cost of the software
  • 10.
    What is aMicroservice A distributed unit of responsibility (logic & state) that is independently versioned, deployed, and scaled Interacts with other microservices over well defined interfaces and protocols like REST or Queue-Based Messaging 10
  • 11.
    Deployment Service Discovery Scaling Security Managing configuration Health& Readiness checks Logging Load balancing Data Persistency Microservices Challenges
  • 12.
  • 13.
    Not the onlygame in town, but certainly the loudest Docker Kubernete s
  • 14.
    Sealed application software. Acontainer image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. What is a container image? / etc dev lib proc rpc ssh systemdudev
  • 15.
    Hypervisor Architecture Free space HostOS Server VM OS App VM OS App VM OS App App VM OS Hypervisor Server Container Host OS Docker Engine App App App App
  • 16.
    Docker is agnosticto the infrastructure layer As a runtime docker provide access to devices, file system, privileges, variables, functions, API etc. App Docker Engine App Dev Machine App Docker Engine App App Docker Engine App Lift and shift
  • 17.
    The development cycle 17 Build ContainerRegistry Binaries Configuration Dependencies Image Container Dockerfile FROM microsoft/dotnet:2.0-runtime WORKDIR /app COPY /app . ENTRYPOINT ["dotnet", "Voting.Processor.dll"] Developer
  • 18.
  • 19.
    Taking Tabs vs.Spaces to the extreme 19 Web (python) API (ASP.NET Core) Redis Worker (.NET Core Console) RabbitMQ
  • 20.
    Kuberenetes An orchestrator thatmanages the containers environment 20 MonitorMonitor Node(s) Pod containercontainer Deployment • Configurations • Secrets • Services (discovery) • …
  • 21.
  • 22.
    Autoscale Limits: Example: if CPU utilizationexceeds 50%, the autoscaler increases the pods to a maximum of 10 22 resources: requests: cpu: 250m limits: cpu: 500m kubectl autoscale deployment azure-vote-front --cpu-percent=50 --min=3 --max=10
  • 23.
    Doing It Right Architect Modularity LowCoupling, High Cohesion Schema/API Versioning DevOps CI/CD Automation Monitor and Act Testing in production Load and Chaos 23
  • 24.
    Summary From Monolith toMicroservices How can Docker help us? Orchestrating microservices with Kubernetes Taking your microservices to the next level 24
  • 25.
    Thank You! 25 Tamir Dresher @tamir_dresher CloudDivision Leader tamirdr@codevalue.net http://tamirdresher.com

Editor's Notes

  • #6 This Photo by Unknown Author is licensed under CC BY-NC-ND This Photo by Unknown Author is licensed under CC BY-SA
  • #7 Large self-contained application Deployed and scaled as a group Storage if often a single store Address the entire set of application needs
  • #18 https://pixabay.com/en/room-person-time-information-clock-44084/
  • #20 How would you manage this infrastructure? Each container is isolated so how would they discover and interact with each other? How would the developer work look? How do you keep it scalable? How do you handle the failures?
  • #24 Free image source: https://pixabay.com/en/approval-female-gesture-hand-happy-15914/
  • #25 This Photo by Unknown Author is licensed under CC BY-NC-ND This Photo by Unknown Author is licensed under CC BY-SA