Skip to content

A containerized polyglot Service Mesh application (Istio) consisting of microservices based on .NET Core, NodeJS and more running on Kubernetes

License

Notifications You must be signed in to change notification settings

weklund/coolstore-microservices

 
 

Repository files navigation

Cool Store Application on Service Mesh

Price Build Status

This project is inspired from coolstore project by jbossdemocentral & Red Hat Demo Central

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.

Slides

Table of contents

Prerequisites

  • Windows 10
  • Windows Subsystem Linux (WSL - Ubuntu OS)
  • Docker for Windows (Kubernetes enabled)
  • kubectl
  • helm
  • istioctl

Services

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

  1. Catalog Service: NodeJS service and MongoDB, serves products and prices for retail products
  1. Cart Service: .NET Core service which manages shopping cart for each customer
  1. Inventory Service: .NET Core service and SQL Server, serves inventory and availability data for retail products
  1. Pricing Service: .NET Core service which is a business rules application for product pricing
  1. Review Service: .NET Core service and SQL Server running for writing and displaying reviews for products
  1. Rating Service: NodeJS service running for rating products
  1. IdP: Identity Provider using IdentityServer4 to authentication with OAuth 2.0 and OpenID Connect for the whole stack
  1. Web UI (PWA): A frontend based on vuejs and Node.js

Architecture Screenshot

Up and Running

  1. Make sure we have docker for windows edge 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. Download istio-1.0.0, and unzip it into somewhere

> 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 --timeout 1000
  1. Then cd into your root of project
> ./cs-build.sh
> ./cs-inject-istio.sh
  1. Install web chart
> helm install -n web deploys/charts/web
  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

> 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 application as
> kubectl delete -f deployment/istio/dev-all-in-one.yaml
> helm delete web --purge
> helm delete istio --purge

Notes:

  1. Global path

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

  1. Export chart to yaml file

If you run it on Docker for Windows, then you cannot run sidecar auto injection so that we need to export coolstore chart to manifest file like

helm template deploys/charts/coolstore -f deploys/charts/coolstore/values.dev.yaml --namespace cs-system > deploys/k8s/dev-all-in-one.yaml
istioctl kube-inject -f deploys/k8s/dev-all-in-one.yaml | kubectl apply -f -
  1. 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

Open API

OpenAPI Screenshot

CI/CD

Lift and Shift

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 Thinh Nguyen
thangchung thinhnguyen

Licence

Code released under the MIT license.

About

A containerized polyglot Service Mesh application (Istio) consisting of microservices based on .NET Core, NodeJS and more running on Kubernetes

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 72.9%
  • JavaScript 14.7%
  • Vue 5.9%
  • Shell 1.9%
  • HTML 1.6%
  • Dockerfile 1.5%
  • Other 1.5%