This repository showcases a production-ready example of .NET microservices in action. It utilizes a range of .NET technologies.
docker-compose --env-file .env -f docker-compose.yml -f docker-compose.override.yml up -d
- all nuget packages must deployed before run
- in case of private feed (PAT) must be configured properly (even for dev environment)
- recommended private storage: Azure Artifact
Specify PAT (Personal Access Token) into .env for access private nuget feeds.
Add .env file to root directory
NUGET_PAT=secretaccesstoken
Needs to be created imperatively (for security reasons).
For example:
kubectl create secret generic game-catalog-db-secret --from-literal=HOST=bcpatrikduch --from-literal=USER_PASS=SolutionsArchitect
kubectl apply -f.\deployment\aks\letsencrypt\
Prerequsities for Windows
- chocolatey
Installation
choco install kubernetes-helm
Installation
helm repo add azure-marketplace https://marketplace.azurecr.io/helm/v1/repo
helm install rabbitmq-service azure-marketplace/rabbitmq
To Access the RabbitMQ AMQP port:
kubectl port-forward --namespace default svc/rabbitmq-service 5672:5672
To Access the RabbitMQ Management interface:
kubectl port-forward --namespace default svc/rabbitmq-service 15672:15672
kubectl apply -f.\deployment\aks\helm\extensions\ingress\install.bat
kubectl apply -f .\deployment\aks\services\ingress\
kubectl apply -f .\deployment\aks\webapps\web-blazor\
kubectl apply -f .\deployment\aks\services\api-gateways\web-gw\
API
kubectl apply -f .\deployment\aks\services\product\product-api\
DB
kubectl apply -f .\deployment\aks\services\product\product-db\
Required secret
kubectl create secret generic product-db-secret --from-literal PGUSERNAME=SolutionArchitect --from-literal PGDBNAME=productdb --from-literal PGPASSWORD=patrikduch
kubectl create secret generic product-kafka-secret --from-literal KAFKASERVERS=KAFKAURL
kubectl create secret generic user-api-secret --from-literal="ConnectionString=Server=user-db-service;Database=userdb;User Id=SolutionArchitect; Password=patrikduch"
kubectl create secret generic user-db-secret --from-literal PGUSERNAME=SolutionArchitect --from-literal PGDBNAME=userdb --from-literal PGPASSWORD=patrikduch
kubectl apply -f .\deployment\aks\services\user\user-db\
kubectl apply -f .\deployment\aks\services\user\user-api\
kubectl apply -f .\deployment\aks\services\identity-auth\
kubectl apply -f .\deployment\aks\services\basket\basket-api
kubectl apply -f .\deployment\aks\services\basket\basket-db\
kubectl create secret generic basket-db-secret --from-literal=ConnectionString=basket-db-service:6379 --from-literal=DiscountUrl=http://discount-grpc-service:80
kubectl apply -f .\deployment\aks\services\catalog\catalog-api
kubectl apply -f .\deployment\aks\services\catalog\catalog-db\
kubectl create secret generic catalog-db-secret --from-literal=Host=catalog-db-service --from-literal=CollectionName=products --from-literal=DatabaseName=ProductsDb --from-literal=Port=27017 --from-literal=ServiceName=Catalog --from-literal=Username=patrikduch --from-literal=Password=bcduchpatrik07041993
kubectl apply -f .\deployment\aks\services\discount\discount-db
kubectl apply -f .\deployment\aks\services\discount\discount-api
kubectl apply -f .\deployment\aks\services\discount\discount-grpc\
kubectl apply -f .\deployment\aks\services\game-catalog\game-catalog-api
kubectl apply -f .\deployment\aks\services\game-catalog\game-catalog-db\
kubectl create secret generic game-catalog-api-secret --from-literal=HOST=game-catalog-db-service --from-literal=COLLECTION=items --from-literal=DB_NAME=ItemsDb --from-literal=USER_NAME=patrikduch --from-literal=USER_PASS=bcpatrikduch07041993 --from-literal=DB_PORT=27017 --from-literal=SERVICE_NAME=GameCatalog --from-literal=RABBITMQ_HOST=amqp://user:UVpizt6Tzj@rabbitmq-service:5672
kubectl apply -f .\deployment\aks\services\inventory\inventory-api
kubectl apply -f .\deployment\aks\services\inventory\inventory-db\
kubectl create secret generic inventory-db-secret --from-literal=Host=inventory-db-service --from-literal=CollectionName=inventories --from-literal=DatabaseName=InventoryDb --from-literal=Port=27017 --from-literal=ServiceName=Inventory --from-literal=Username=patrikduch --from-literal=Password=bcduchpatrik07041993 --from-literal=RABBITMQ_HOST=amqp://user:UVpizt6Tzj@rabbitmq-service:5672
kubectl apply -f .\deployment\aks\services\realtime-transmission\realtime-transmission-api
kubectl apply -f .\deployment\aks\services\realtime-transmission\realtime-transmission-db\
kubectl apply -f .\deployment\aks\services\ordering\ordering-api
kubectl apply -f .\deployment\aks\services\ordering\ordering-db\
kubectl create secret generic ordering-api-secret --from-literal="ConnectionString=Server=ordering-db-service;Database=OrderDb;User Id=sa; Password=bcduchpatrik07041993"
kubectl create secret generic ordering-db-secret --from-literal=SA_PASSWORD=bcduchpatrik07041993
kubectl apply -f .\deployment\aks\services\customer\customer-api
kubectl apply -f .\deployment\aks\services\customer\customer-db\
kubectl create secret generic customer-api-secret --from-literal="ConnectionString=Server=customer-db-service;Database=CustomerDb;User Id=sa; Password=bcduchpatrik07041993"
kubectl create secret generic customer-db-secret --from-literal=SA_PASSWORD=bcduchpatrik07041993
kubectl apply -f .\deployment\aks\services\project-detail\project-detail-api
kubectl apply -f .\deployment\aks\services\project-detail\project-detail-db\
kubectl create secret generic project-detail-api-secret --from-literal="ConnectionString=Server=project-detail-db-service;Database=ProjectDetailDb;User Id=sa; Password=bcduchpatrik07041993"
kubectl create secret generic project-detail-db-secret --from-literal=SA_PASSWORD=bcduchpatrik07041993
kubectl apply -f .\deployment\aks\extensions\
kubectl apply -f .\deployment\aks\webapps\
kubectl apply -f .\deployment\aks\examples\ingress-controller\without-cors\
Postgres
kubectl apply -f .\deployment\aks\examples\dbs\postgres\
Postgres-Azure-Disk
kubectl apply -f .\deployment\aks\examples\dbs\postgres\postgres-azure\
kubectl apply -f .\deployment\aks\examples\dbs\redis
kubectl apply -f .\deployment\aks\examples\dbs\mssql\
MSSQL
kubectl create secret generic mssql-db-secret --from-literal=SA_PASSWORD=bcduchpatrik07041993