In this video
Today we continue with Veer Muchandi's series of 4 videos that will guide you through every detail you need to know to start building and running your own Microservices.
This third video in the series takes an example with three different microservices that come together to form an application. While each microservice is written in a different language, it show cases how developers will build microservices with their code in a git repository.
Notes
The code used in this example is available on github at https://github.com/debianmaster/microservices-on-openshift
Steps to create these microservices the first time:
Create some environment variable that makes it easy to deal with some of the parameters we use in the subsequent commands
export OSE_PROJECT=<
export OSE_DOMAIN=<>
Microservice #1.
Creating the Email Microservice:
The command below creates a new application for email service. This service receives the email request and sends out the email.
oc new-app --context-dir='python-email-api' https://github.com/debianmaster/microservices-on-openshift.git --name=emailsvc --image-stream='python:2.7' -l microservice=emailsvc
Microservice #2.
Creating the User Registration Backend Service :
This has two steps:
1- Create a MongoDB database
oc new-app -e MONGODB_USER=mongouser,MONGODB_PASSWORD=password,MONGODB_DATABASE=userdb,MONGODB_ADMIN_PASSWORD=password registry.access.redhat.com/rhscl/mongodb-26-rhel7 --name mongodb -l microservice=userregsvc
2- Create the User Registration Service and expose the service so that we can use a URL to make calls to the REST APIs exposed by this service. This service uses the MongoDB database and Email service created earlier.
oc new-app -e EMAIL_APPLICATION_DOMAIN=http://emailsvc:8080,MONGODB_DATABASE=userdb,MONGODB_PASSWORD=password,MONGODB_USER=mongouser,DATABASE_SERVICE_NAME=mongodb --context-dir='nodejs-users-api' https://github.com/debianmaster/microservices-on-openshift.git --name='userregsvc' -l microservice=userregsvc
oc expose svc/userregsvc
Microservice #3.
Create a front-end UserRegistration application and expose the service so that we can use a URL to access the webpages.
oc new-app -e USER_REGISTRATION_APPLICATION_DOMAIN="http://userregsvc-$OSE_PROJECT.$OSE_DOMAIN" --context-dir='php-ui' https://github.com/debianmaster/microservices-on-openshift.git --name='userreg' -l microservice=userregfrontend
oc expose svc/userreg
The Authors
This series of videos was created by Veer Muchandi in collaboration with Chakradhar Jonagam.
Chakradhar Jonagam works as a Solution Architect at Red Hat.
He helps companies architect their PaaS infrastructure, Prior to this he was a full stack developer with some infosec background. In his free time he loves to take long hikes.
You can find many of Veer's blog posts here. He has created a multitude of demos that cover interesting aspects of the OpenShift Platform.
You can also follow Veer's twitter account: @VeerMuchandi
Other Videos
View the Entire OpenShift 3 Demo Playlist
For the latest information on OpenShift 3, please visit enterprise.openshift.com.
About the author
Browse by channel
Automation
The latest on IT automation that spans tech, teams, and environments
Artificial intelligence
Explore the platforms and partners building a faster path for AI
Open hybrid cloud
Explore how we build a more flexible future with hybrid cloud
Security
Explore how we reduce risks across environments and technologies
Edge computing
Updates on the solutions that simplify infrastructure at the edge
Infrastructure
Stay up to date on the world’s leading enterprise Linux platform
Applications
The latest on our solutions to the toughest application challenges
Original shows
Entertaining stories from the makers and leaders in enterprise tech
Products
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Cloud services
- See all products
Tools
- Training and certification
- My account
- Developer resources
- Customer support
- Red Hat value calculator
- Red Hat Ecosystem Catalog
- Find a partner
Try, buy, & sell
Communicate
About Red Hat
We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.
Select a language
Red Hat legal and privacy links
- About Red Hat
- Jobs
- Events
- Locations
- Contact Red Hat
- Red Hat Blog
- Diversity, equity, and inclusion
- Cool Stuff Store
- Red Hat Summit