Cool Store Application on Service Mesh
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.
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:
- Catalog Service
- NodeJS service and MongoDB, serves products and prices for retail products
http://localhost:5002
- Cart Service
- .NET Core service which manages shopping cart for each customer
http://localhost:5003
- Inventory Service
- .NET Core service and SQL Server, serves inventory and availability data for retail products
http://localhost:5004
- Pricing Service
- .NET Core service which is a business rules application for product pricing
http://localhost:5005
- Review Service
- .NET Core service and SQL Server running for writing and displaying reviews for products
http://localhost:5006
- Rating Service
- NodeJS service running for rating products
http://localhost:5007
- Coolstore Gateway
- ingress-nginx service running that serving as an API gateway to the backend services
http://localhost:5000
- IDP
- Identity Provider using IdentityServer4 to authentication with OAuth 2.0 and OpenID Connect for the whole stack
http://localhost:5001
- Web UI (PWA)
Up and Running
-
Make sure we have
docker for windows
edge running withkubernetes
option enabled. We need to installkubectl
,helm
andistioctl
on the build machine as well. -
From current console, type
bash
to enterLinux Subsystem (Ubuntu)
-
Download
istio istio-1.0.0-snapshot.2
, and unzip it into somewhere
> cd <istio-1.0.0-snapshot.2 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
- Then
cd
into your root of project
> ./cs-build.sh
> ./cs-inject-istio.sh
- Install
web
chart
> helm install -n web deploys/charts/web
- 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
- Clean up
coolstore
application as
> kubectl delete -f deployment/istio/dev-all-in-one.yaml
> helm delete web --purge
> helm delete istio --purge
Notes:
If you want to run just only
Kubernetes
+nginx-ingress
go todeploys/charts/coolstore/values.yaml
and addnginx: enabled: true
Then run the
helm
command ashelm install --name cs-nginx stable/nginx-ingress
If you run it on
Docker for Windows
, then you cannot run sidecar auto injection so that we need to exportcoolstore
chart to manifest file likehelm template deploys/charts/coolstore -f deploys/charts/coolstore/values.dev.yaml --namespace cs-system > deploys/istio/dev-all-in-one.yaml istioctl kube-inject -f deploys/istio/dev-all-in-one.yaml | kubectl apply -f -
Open API
CI/CD
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :p
Contributors
Thang Chung | Thinh Nguyen |
---|---|
Licence
Code released under the MIT license.