SlideShare a Scribd company logo
MONOLITHS TO MICROSERVICES: APP
TRANSFORMATION
Hands-on Technical Workshop
Ram Maddali
Senior Architect
@RamMaddali
rmaddali@redhat.com
Anand Akella
Senior Architect
aakella@redhat.com
A DEVELOPER INTRODUCTION TO
OPENSHIFT
CONTAINERS & CLOUD-NATIVE ROADSHOW3
A secure and enterprise-grade container
application platform based on Kubernetes for
traditional and cloud-native applications
CONTAINERS & CLOUD-NATIVE ROADSHOW4
CLOUD-NATIVE CAPABILITIES WITH
RED HAT OPENSHIFT
ANY
CONTAINER
Amazon Web Services Microsoft Azure Google CloudOpenStackDatacenterLaptop
ANY
INFRASTRUCTURE
APPLICATION LIFECYCLE MANAGEMENT
CONTAINER ORCHESTRATION AND MANAGEMENT
ENTERPRISE CONTAINER HOST
CONTAINERS & CLOUD-NATIVE ROADSHOW5
CLOUD-NATIVE CAPABILITIES WITH
RED HAT OPENSHIFT
APPLICATION LIFECYCLE MANAGEMENT
CONTAINER ORCHESTRATION AND MANAGEMENT
ENTERPRISE CONTAINER HOST
Service Discovery Routing Load Balancing
Security
Monitoring
Conf Management Log Management Multi-tenancy
Self-ServiceBuild Automation Deploy Automation CI/CD
ANY
CONTAINER
Amazon Web Services Microsoft Azure Google CloudOpenStackDatacenterLaptop
ANY
INFRASTRUCTURE
A container is the smallest compute unit
CONTAINER
containers are created from
container images during a build
CONTAINER
CONTAINER
IMAGE
BINARY RUNTIME
IMAGE REGISTRY
container images are stored in
an image registry
CONTAINER
CONTAINER
IMAGE
CONTAINER
IMAGE
CONTAINER
IMAGE
CONTAINER
IMAGE
CONTAINER
IMAGE
CONTAINER
IMAGE
an image repository contains all versions of an
image in the image registry
IMAGE REPOSITORY
frontend:latest
frontend:2.0
frontend:1.1
frontend:1.0
CONTAINER
IMAGE
mongo:latest
mongo:3.7
mongo:3.6
mongo:3.4
CONTAINER
IMAGE
myregistry/frontend myregistry/mongo
PODPOD
containers are wrapped in pods which are
units of deployment and management, and
share a common network address
CONTAINER CONTAINERCONTAINER
IP: 10.1.0.11 IP: 10.1.0.55
pods configuration is defined
in a deployment
image name
replicas
labels
cpu
memory
storage
POD
CONTAINER
POD
CONTAINER
POD
CONTAINER
DEPLOYMENT
NODE (RHEL)
pods are deployed to and run on nodes
POD
CONTAINER
POD
CONTAINER
POD
CONTAINER
NODE (RHEL)
POD
CONTAINER
POD
CONTAINER
POD
CONTAINER
POD
services provide internal load-balancing and
service discovery across pods
CONTAINER
POD
CONTAINER
POD
CONTAINER
BACKEND SERVICE
POD
CONTAINER
role: backend
role: backendrole: backendrole: backendrole: frontend
POD
apps can talk to each other via services
CONTAINER
POD
CONTAINER
POD
CONTAINER
BACKEND SERVICE
POD
CONTAINER
role: backend
role: backendrole: backendrole: backendrole: frontend
Invoke
Backend API
POD
routes add services to the external load-balancer and
provide readable urls for the app
CONTAINER
POD
CONTAINER
POD
CONTAINER
BACKEND SERVICE
ROUTE
app-prod.mycompany.com
> curl http://app-prod.mycompany.com
projects isolate apps across environments,
teams, groups and departments
POD
C
POD
C
POD
C
PAYMENT DEV
POD
C
POD
C
POD
C
PAYMENT PROD
POD
C
POD
C
POD
C
CATALOG
POD
C
POD
C
POD
C
INVENTORY
❌
❌❌
templates define a blueprint for an
application that can be instantiated within
a project
TEMPLATE (name=”foo”)
source
output
triggers
name
labels
strategy
BUILD CONFIG
image name
replicas
labels
cpu
memory
storage
DEPLOYMENT
name
labels
port
targetPort
selectors
protocol
SERVICE
name
destination
termination
hostname
ROUTE
name
labels
repo
IMAGESTREAM
$ oc new-app foo
LAB: DEVELOPER INTRODUCTION TO
OPENSHIFT
CURRENT STATE
OpenShift
coolstore-dev
Coolstore
monolith
Coolstore
database
(dev)
Coolstore
Binary
mvn package
GOAL FOR LAB
In this lab you will learn:
● Important OpenShift concepts for developers
● How OpenShift makes developers and architects happier
● How to do efficient round-trip development:
○ Separate dev from prod environments
○ Quick deployments using rsync / port-forwarding
○ Promoting apps using CI/CD Pipelines
LAB: DEVELOPER INTRO TO OPENSHIFT
SCENARIO 3 A DEVELOPER INTRODUCTION TO OPENSHIFT
WEB: openshift-modernize-apps.katacoda.com
WRAP-UP AND DISCUSSION
RESULT OF LAB
In this lab you learned how to:
● Do quick deployments with oc rsync
● Create a production environment separate from dev
● Promote tested/verified builds between environments using
OpenShift pipeline builds
You should now have two projects (dev and prod) running the
same CoolStore app! In the next lab we will begin the process of
breaking the monolith up into microservices.
DESIRED RESULT OF SCENARIO 3
OpenShift
coolstore-dev
Coolstore
monolith
Coolstore
database
(dev)
Coolstore
Binary
coolstore-prod
Coolstore
monolith
Coolstore
database
(prod)
Pipeline
Promotion
mvn package
LEARN MORE: learn.openshift.com
THANK YOU
plus.google.com/+RedHat
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHatNews

More Related Content

Developer intro to open shift

  • 1. MONOLITHS TO MICROSERVICES: APP TRANSFORMATION Hands-on Technical Workshop Ram Maddali Senior Architect @RamMaddali rmaddali@redhat.com Anand Akella Senior Architect aakella@redhat.com
  • 3. CONTAINERS & CLOUD-NATIVE ROADSHOW3 A secure and enterprise-grade container application platform based on Kubernetes for traditional and cloud-native applications
  • 4. CONTAINERS & CLOUD-NATIVE ROADSHOW4 CLOUD-NATIVE CAPABILITIES WITH RED HAT OPENSHIFT ANY CONTAINER Amazon Web Services Microsoft Azure Google CloudOpenStackDatacenterLaptop ANY INFRASTRUCTURE APPLICATION LIFECYCLE MANAGEMENT CONTAINER ORCHESTRATION AND MANAGEMENT ENTERPRISE CONTAINER HOST
  • 5. CONTAINERS & CLOUD-NATIVE ROADSHOW5 CLOUD-NATIVE CAPABILITIES WITH RED HAT OPENSHIFT APPLICATION LIFECYCLE MANAGEMENT CONTAINER ORCHESTRATION AND MANAGEMENT ENTERPRISE CONTAINER HOST Service Discovery Routing Load Balancing Security Monitoring Conf Management Log Management Multi-tenancy Self-ServiceBuild Automation Deploy Automation CI/CD ANY CONTAINER Amazon Web Services Microsoft Azure Google CloudOpenStackDatacenterLaptop ANY INFRASTRUCTURE
  • 6. A container is the smallest compute unit CONTAINER
  • 7. containers are created from container images during a build CONTAINER CONTAINER IMAGE BINARY RUNTIME
  • 8. IMAGE REGISTRY container images are stored in an image registry CONTAINER CONTAINER IMAGE CONTAINER IMAGE CONTAINER IMAGE CONTAINER IMAGE CONTAINER IMAGE CONTAINER IMAGE
  • 9. an image repository contains all versions of an image in the image registry IMAGE REPOSITORY frontend:latest frontend:2.0 frontend:1.1 frontend:1.0 CONTAINER IMAGE mongo:latest mongo:3.7 mongo:3.6 mongo:3.4 CONTAINER IMAGE myregistry/frontend myregistry/mongo
  • 10. PODPOD containers are wrapped in pods which are units of deployment and management, and share a common network address CONTAINER CONTAINERCONTAINER IP: 10.1.0.11 IP: 10.1.0.55
  • 11. pods configuration is defined in a deployment image name replicas labels cpu memory storage POD CONTAINER POD CONTAINER POD CONTAINER DEPLOYMENT
  • 12. NODE (RHEL) pods are deployed to and run on nodes POD CONTAINER POD CONTAINER POD CONTAINER NODE (RHEL) POD CONTAINER POD CONTAINER POD CONTAINER
  • 13. POD services provide internal load-balancing and service discovery across pods CONTAINER POD CONTAINER POD CONTAINER BACKEND SERVICE POD CONTAINER role: backend role: backendrole: backendrole: backendrole: frontend
  • 14. POD apps can talk to each other via services CONTAINER POD CONTAINER POD CONTAINER BACKEND SERVICE POD CONTAINER role: backend role: backendrole: backendrole: backendrole: frontend Invoke Backend API
  • 15. POD routes add services to the external load-balancer and provide readable urls for the app CONTAINER POD CONTAINER POD CONTAINER BACKEND SERVICE ROUTE app-prod.mycompany.com > curl http://app-prod.mycompany.com
  • 16. projects isolate apps across environments, teams, groups and departments POD C POD C POD C PAYMENT DEV POD C POD C POD C PAYMENT PROD POD C POD C POD C CATALOG POD C POD C POD C INVENTORY ❌ ❌❌
  • 17. templates define a blueprint for an application that can be instantiated within a project TEMPLATE (name=”foo”) source output triggers name labels strategy BUILD CONFIG image name replicas labels cpu memory storage DEPLOYMENT name labels port targetPort selectors protocol SERVICE name destination termination hostname ROUTE name labels repo IMAGESTREAM $ oc new-app foo
  • 20. GOAL FOR LAB In this lab you will learn: ● Important OpenShift concepts for developers ● How OpenShift makes developers and architects happier ● How to do efficient round-trip development: ○ Separate dev from prod environments ○ Quick deployments using rsync / port-forwarding ○ Promoting apps using CI/CD Pipelines
  • 21. LAB: DEVELOPER INTRO TO OPENSHIFT SCENARIO 3 A DEVELOPER INTRODUCTION TO OPENSHIFT WEB: openshift-modernize-apps.katacoda.com
  • 23. RESULT OF LAB In this lab you learned how to: ● Do quick deployments with oc rsync ● Create a production environment separate from dev ● Promote tested/verified builds between environments using OpenShift pipeline builds You should now have two projects (dev and prod) running the same CoolStore app! In the next lab we will begin the process of breaking the monolith up into microservices.
  • 24. DESIRED RESULT OF SCENARIO 3 OpenShift coolstore-dev Coolstore monolith Coolstore database (dev) Coolstore Binary coolstore-prod Coolstore monolith Coolstore database (prod) Pipeline Promotion mvn package