Skip to content

This repository is for Google sample Online Boutique Microservices Deployment using Kubernetes.

Notifications You must be signed in to change notification settings

surajdubey08/online-shop-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Online Boutique is a cloud-first microservices demo application. Online Boutique consists of an 11-tier microservices application. The application is a web-based e-commerce app where users can browse items, add them to the cart, and purchase them.

Google uses this application to demonstrate the use of technologies like Kubernetes, GKE, Istio, Stackdriver, and gRPC. This application works on any Kubernetes cluster, like Google Kubernetes Engine (GKE). It’s easy to deploy with little to no configuration.

Credits: Link to GitHub repository

Screenshots

Home Page Checkout Screen
Screenshot of store homepage Screenshot of checkout screen

Architecture

Online Boutique is composed of 11 microservices written in different languages that talk to each other over gRPC.

Architecture of microservices

Service Language Description
frontend Go Exposes an HTTP server to serve the website. Does not require signup/login and generates session IDs for all users automatically.
cartservice C# Stores the items in the user's shopping cart in Redis and retrieves it.
productcatalogservice Go Provides the list of products from a JSON file and ability to search products and get individual products.
currencyservice Node.js Converts one money amount to another currency. Uses real values fetched from European Central Bank. It's the highest QPS service.
paymentservice Node.js Charges the given credit card info (mock) with the given amount and returns a transaction ID.
shippingservice Go Gives shipping cost estimates based on the shopping cart. Ships items to the given address (mock)
emailservice Python Sends users an order confirmation email (mock).
checkoutservice Go Retrieves user cart, prepares order and orchestrates the payment, shipping and the email notification.
recommendationservice Python Recommends other products based on what's given in the cart.
adservice Java Provides text ads based on given context words.
loadgenerator Python/Locust Continuously sends requests imitating realistic user shopping flows to the frontend.

Deploy the Online Boutique Microservices in a Kubernetes cluster

Prerequisites

  • Create Account on any Managed Kubernetes Cluster Provider (e.g. Linode, DigitalOcean, AWS, Azure, GKE, etc..). We will be using Linode as our managed kubernetes cluster provider.
  • Install kubectl in your local machine
  • Install helm in your local machine
  • Install helmfile in your local machine

Deploying the micro-services using kubernetes manifests file into Linode Kubernetes Cluster

kubernetes-manifests.yaml

Steps:

  1. Create a Linode Kubernetes Cluster. Wait for the cluster nodes to get ready and start running (this may take few minutes).

    Create Kubernetes Cluster on Linode

  2. Download the *-kubeconfig.yaml file as using this file we will be connecting to the Linod Kubernetes cluster.

    After successful creation of the cluster

  3. Open a terminal shell and save your kubeconfig file’s path to the $KUBECONFIG environment variable. In the example command, the kubeconfig file is located in the Downloads folder, but you should alter this line with this folder’s location on your computer

    export KUBECONFIG=~/Downloads/kubeconfig.yaml

    Export of KUBECONFIG as ENV variable

  4. Check if connection to the Linode Kubernetes Cluster is done or not by using:

    kubectl get node

    Check if connection to the Linode Kubernetes Cluster is done or not

  5. Create a namespace to deploy all of our resouces.

    kubectl create ns online-boutique

    Create Namespace

  6. Deploy the Kubernetes Manifest file using the below command

    kubectl apply -f online-shop-microservices/kubernetes-manifests.yaml -n online-boutique

    Create Namespace

  7. To check all deployed resources use:

    kubectl get all -n online-boutique

  8. To access the front-end microservice, first get the port number in which the front-end service is exposed to using:

    kubectl get service -n online-boutique

    Get Service Port

The service can now be accessed using the any of the Node IP inside the cluster with the frontend service port number Check the webpage

Home Page Checkout Screen
Screenshot of store homepage Screenshot of checkout screen

Deploying the micro-services using Helm Charts and Helmfile into Linode Kubernetes Cluster

Steps:

  1. Steps 1-5 will be same as above.

  2. Create Helm Charts and Helmfile.

  3. Deploy the Helm Charts using Helmfile:

    helmfile sync -f online-shop-microservices/helmfile.yaml

    Deployment of micro-services using helmfile

The log from helmfile sync command will be huge but it is good to go through it to understand what all services got deployed

The service can now be accessed using the any of the Node IP inside the cluster with the frontend service port number Check the webpage

Home Page Checkout Screen
Screenshot of store homepage Screenshot of checkout screen

About

This repository is for Google sample Online Boutique Microservices Deployment using Kubernetes.

Topics

Resources

Stars

Watchers

Forks