Skip to content
🎡 A crafted gRPC µServices: Go the extra mile with .NET ecosystem with GraphQL on the service mesh
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
assets #41 handle error for gRPC Mar 18, 2019
deploys #43 add more docs Mar 9, 2019
docs #41 handle error for gRPC Mar 18, 2019
src #41 add apollo-react-hook Mar 19, 2019
.dockerignore Revert "Documentation update for 0.1.0" Mar 2, 2019
.editorconfig
.env #41 handle error for gRPC Mar 18, 2019
.gitattributes Revert "Documentation update for 0.1.0" Mar 2, 2019
.gitignore 🐛 ignore submodule after install grpc-swagger-gen Mar 9, 2019
.gitmodules
.travis.yml Revert "Documentation update for 0.1.0" Mar 2, 2019
CODE_OF_CONDUCT.md Revert "Documentation update for 0.1.0" Mar 2, 2019
LICENSE Revert "Documentation update for 0.1.0" Mar 2, 2019
NuGet.config
README.md Revert "Documentation update for 0.1.0" Mar 2, 2019
azure-pipelines.yml Revert "Documentation update for 0.1.0" Mar 2, 2019
codecov.yml Revert "Documentation update for 0.1.0" Mar 2, 2019
coolstore.sln #41 start to work on GraphQL Mar 4, 2019
coolstore.sln.DotSettings Revert "Documentation update for 0.1.0" Mar 2, 2019
docker-compose-graphql.dev.yml #41 handle error for gRPC Mar 18, 2019
docker-compose-graphql.headless.yml #41 add apollo-react-hook Mar 19, 2019
docker-compose-graphql.yml #41 handle error for gRPC Mar 18, 2019
docker-compose.yml #41 expose endpoint to docker-compose Mar 6, 2019
global.json Revert "Documentation update for 0.1.0" Mar 2, 2019
runall.bat

README.md

Cool Store: Cloud-Native Microservices Application on Service Mesh

Travis (.org) Build Status Price OpenTracing Badge

This project is inspired from CoolStore project by JBoss Demo Central & Red Hat Demo Central

The structure of README is inspired from GoogleCloudPlatform Demo.

CoolStore is a containerised polyglot microservices application consisting of services based on .NET Core, NodeJS and more running on Service Mesh.

It demonstrates how to wire up small microservices into a larger application using microservice architectural principals.

Presentation

Our team uses this demo application to demonstrate Kubernetes, AKS, Istio and similar cloud-native technologies in events as following

Check out my blog, my chat or say hi on Twitter!

Table of contents

Prerequisites

  • Windows 10: The OS for developing and building this demo application .
  • Windows Subsystem Linux - Ubuntu OS: The subsystem that helps to run easily the bash shell on Windows OS.
  • Docker for Desktop (Kubernetes enabled): The easiest tool to run Docker, Docker Swarm and Kubernetes on Mac and Windows.
  • Kubernetes/AKS: The app is designed to run on Kubernetes (both locally on "Docker for Desktop", as well as on the cloud with AKS).
  • Istio: Application works on Istio service mesh.
  • helm: The best package manager to find, share, and use software built for Kubernetes.
  • skaffold: Easy and Repeatable Kubernetes Development.
  • NetCoreKit: Set of Cloud-native tools and utilities for .NET Core.

Overall Architecture of µServices

Architecture Screenshot

There are several individual µservices and infrastructure components that make up this app:

No. Service Description Source Endpoints
1. IdP (.NET Core + In-memory database) Uses IdentityServer4 to authentication with OAuth 2.0 and OpenID Connect for the whole stack code dev & staging
2. Catalog (Node.js + Mongo) Serves products and prices for retail products code dev & staging
3. Cart (.NET Core + MySQL) Manages shopping cart for each customer code dev & staging
4. Inventory (.NET Core + MySQL) Serves inventory and availability data for retail products code dev & staging
5. Pricing (.NET Core + MySQL) Handles a business rules application for product pricing code dev & staging
6. Review (.NET Core + MySQL) Runs for writing and displaying reviews for products code dev & staging
7. Rating (Node.js + Mongo) Runs for rating products code dev & staging
8. Web UI (Obsoleted) Frontend based on Blazor - Full-stack web development with C# and WebAssembly code dev & staging
9. Web UI (PWA - Vuejs + Node.js) Frontend based on vuejs and Node.js code dev & staging

Installation

Development environment: Up and Running locally with "Docker for Desktop"
  1. Make sure we have Docker for Desktop running with Kubernetes option enabled. We need to install kubectl, helm and istioctl on the build machine as well.

  2. From current console, type bash to enter Linux Subsystem (Ubuntu)

  3. Then cd into your root of project

> ./deploys/scripts/build-all-images.sh

It should run and package all docker images.

  1. Download and install istio-1.0.0 on the box, and unzip it into somewhere, then initialize it with following commands
> cd <istio-1.0.0 path>
> kubectl create -f install/kubernetes/helm/helm-service-account.yaml
> helm init --service-account tiller --upgrade
> helm install install/kubernetes/helm/istio --name istio --namespace istio-system

More information about installing istio can be found at https://istio.io/docs/setup/kubernetes/helm-install

  1. Apply istioctl command to coolstore chart (please create k8s folder in folder deploys)
> helm template deploys/charts/coolstore -f deploys/charts/coolstore/values.dev.yaml > deploys/k8s/coolstore.local.yaml
> istioctl kube-inject -f deploys/k8s/coolstore.local.yaml | kubectl apply -f -
  1. Add hosts file with following content
127.0.0.1 api.coolstore.local
127.0.0.1 id.coolstore.local
127.0.0.1 coolstore.local

Waiting for the container provision completed

  1. Install coolstore-istio chart
> helm install deploys\charts\coolstore-istio --name coolstore-istio
  1. Access to following URLs
> curl -I http://coolstore.local # website
> curl -I http://api.coolstore.local # api gateway
> curl -I http://id.coolstore.local # identity provider
  1. Clean up coolstore chart as
> kubectl delete -f deployment/istio/coolstore.local.yaml
> helm delete coolstore-istio --purge
> helm delete istio --purge

Notes:

  1. Global path

    Set PATH for docker, kubectl, helm, and istioctl.

  2. Run with Nginx (not recommendation)

    If you want to run just only Kubernetes + nginx-ingress go to deploys/charts/coolstore/values.yaml, and modify as following

    nginx:
       enabled: true
    

    Then run the helm command as

    helm install --name cs-nginx stable/nginx-ingress
    
Staging and Production environments: Up and Running on Azure Kubernetes Service (AKS)

5 steps to bring CoolStore’s Service Mesh to Azure Kubernetes Service

µService Development

Guidance for developing µService can be found at Clean Domain-Driven Design in 10 minutes

µService Screenshot

Open API

OpenAPI Screenshot

CI/CD

Lift and Shift

Service Mesh

Istio provide a wealth of benefits for the organizations that use them. There’s no denying, however, that adopting the cloud can put strains on DevOps teams. Developers must use microservices to architect for portability, meanwhile operators are managing extremely large hybrid and multi-cloud deployments. Istio lets you connect, secure, control, and observe services.

Distributed Tracing

DAG chart

Trace chart

Metrics

Metrics chart

Screenshots

Home page

home-page

Cart page

cart-page

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :p

Contributors


Thang Chung

Core Developer


Thinh Nguyen

Core Developer


Stuart Leeks

Contributor


Phi Huynh

Contributor

Licence

Code released under the MIT license.

You can’t perform that action at this time.