Browse Source

Merge branch 'dev'

pull/1105/head 2.2.0
eiximenis 5 years ago
parent
commit
ce8d81dbf9
984 changed files with 67176 additions and 67221 deletions
  1. +1
    -3
      .dockerignore
  2. +7
    -0
      .gitignore
  3. +67
    -0
      CONTRIBUTING.md
  4. +3
    -0
      NuGet.config
  5. +78
    -15
      README.md
  6. +50
    -0
      build/azure-devops/apigws/azure-pipelines.yml
  7. +45
    -0
      build/azure-devops/basket-api/azure-pipelines.yml
  8. +45
    -0
      build/azure-devops/catalog-api/azure-pipelines.yml
  9. +45
    -0
      build/azure-devops/identity-api/azure-pipelines.yml
  10. +45
    -0
      build/azure-devops/location-api/azure-pipelines.yml
  11. +45
    -0
      build/azure-devops/marketing-api/azure-pipelines.yml
  12. +44
    -0
      build/azure-devops/mobile-shopping-agg/azure-pipelines.yml
  13. +47
    -0
      build/azure-devops/ordering-api/azure-pipelines.yml
  14. +45
    -0
      build/azure-devops/payment-api/azure-pipelines.yml
  15. +5
    -0
      build/azure-devops/readme.md
  16. +44
    -0
      build/azure-devops/web-shopping-agg/azure-pipelines.yml
  17. +45
    -0
      build/azure-devops/webhooks-api/azure-pipelines.yml
  18. +45
    -0
      build/azure-devops/webhooks-client/azure-pipelines.yml
  19. +45
    -0
      build/azure-devops/webmvc/azure-pipelines.yml
  20. +45
    -0
      build/azure-devops/webspa/azure-pipelines.yml
  21. +45
    -0
      build/azure-devops/webstatus/azure-pipelines.yml
  22. +1
    -1
      cli-windows/build-images.ps1
  23. +3
    -2
      cli-windows/start-windows-containers.ps1
  24. +2
    -2
      deploy/az/servicebus/readme.md
  25. +247
    -0
      docker-compose-tests.override.yml
  26. +130
    -0
      docker-compose-tests.yml
  27. +0
    -138
      docker-compose-windows.yml
  28. +2
    -7
      docker-compose.override.windows.yml
  29. +200
    -106
      docker-compose.override.yml
  30. +0
    -1
      docker-compose.prod.yml
  31. +39
    -0
      docker-compose.windows.yml
  32. +142
    -66
      docker-compose.yml
  33. +8
    -0
      docker-scripts/linux/install-node.sh
  34. +4
    -0
      docker-scripts/win/install-node.cmd
  35. BIN
      docs/Decks/BRK3175_CesarDeIaTorre.pptx
  36. BIN
      docs/Decks/eShopOnContainers-Architecture-v2.1.pptx
  37. +686
    -521
      eShopOnContainers-ServicesAndWebApps.sln
  38. +709
    -466
      eShopOnContainers.sln
  39. +0
    -5
      global.json
  40. +0
    -23
      hosts
  41. +1
    -3
      k8s/deploy-ingress-azure.ps1
  42. +2
    -0
      k8s/deploy-ingress-dockerlocal.ps1
  43. +1
    -8
      k8s/deploy-ingress.ps1
  44. +4
    -0
      k8s/deploy.ps1
  45. +18
    -0
      k8s/helm-rbac.yaml
  46. +12
    -0
      k8s/helm/aks-httpaddon-cfg.yaml
  47. +21
    -0
      k8s/helm/apigwmm/.helmignore
  48. +5
    -0
      k8s/helm/apigwmm/Chart.yaml
  49. +34
    -0
      k8s/helm/apigwmm/configuration-mobile-marketing.json
  50. +2
    -0
      k8s/helm/apigwmm/templates/NOTES.txt
  51. +32
    -0
      k8s/helm/apigwmm/templates/_helpers.tpl
  52. +53
    -0
      k8s/helm/apigwmm/templates/_names.tpl
  53. +21
    -0
      k8s/helm/apigwmm/templates/configmap.yaml
  54. +103
    -0
      k8s/helm/apigwmm/templates/deployment.yaml
  55. +33
    -0
      k8s/helm/apigwmm/templates/ingress.yaml
  56. +14
    -0
      k8s/helm/apigwmm/templates/ocelot-cm.yaml
  57. +19
    -0
      k8s/helm/apigwmm/templates/service.yaml
  58. +64
    -0
      k8s/helm/apigwmm/values.yaml
  59. +21
    -0
      k8s/helm/apigwms/.helmignore
  60. +5
    -0
      k8s/helm/apigwms/Chart.yaml
  61. +142
    -0
      k8s/helm/apigwms/configuration-mobile-shopping.json
  62. +2
    -0
      k8s/helm/apigwms/templates/NOTES.txt
  63. +32
    -0
      k8s/helm/apigwms/templates/_helpers.tpl
  64. +54
    -0
      k8s/helm/apigwms/templates/_names.tpl
  65. +21
    -0
      k8s/helm/apigwms/templates/configmap.yaml
  66. +103
    -0
      k8s/helm/apigwms/templates/deployment.yaml
  67. +33
    -0
      k8s/helm/apigwms/templates/ingress.yaml
  68. +14
    -0
      k8s/helm/apigwms/templates/ocelot-cm.yaml
  69. +19
    -0
      k8s/helm/apigwms/templates/service.yaml
  70. +64
    -0
      k8s/helm/apigwms/values.yaml
  71. +21
    -0
      k8s/helm/apigwwm/.helmignore
  72. +5
    -0
      k8s/helm/apigwwm/Chart.yaml
  73. +34
    -0
      k8s/helm/apigwwm/configuration-web-marketing.json
  74. +2
    -0
      k8s/helm/apigwwm/templates/NOTES.txt
  75. +32
    -0
      k8s/helm/apigwwm/templates/_helpers.tpl
  76. +54
    -0
      k8s/helm/apigwwm/templates/_names.tpl
  77. +21
    -0
      k8s/helm/apigwwm/templates/configmap.yaml
  78. +103
    -0
      k8s/helm/apigwwm/templates/deployment.yaml
  79. +33
    -0
      k8s/helm/apigwwm/templates/ingress.yaml
  80. +14
    -0
      k8s/helm/apigwwm/templates/ocelot-cm.yaml
  81. +19
    -0
      k8s/helm/apigwwm/templates/service.yaml
  82. +64
    -0
      k8s/helm/apigwwm/values.yaml
  83. +21
    -0
      k8s/helm/apigwws/.helmignore
  84. +5
    -0
      k8s/helm/apigwws/Chart.yaml
  85. +154
    -0
      k8s/helm/apigwws/configuration-web-shopping.json
  86. +2
    -0
      k8s/helm/apigwws/templates/NOTES.txt
  87. +32
    -0
      k8s/helm/apigwws/templates/_helpers.tpl
  88. +53
    -0
      k8s/helm/apigwws/templates/_names.tpl
  89. +21
    -0
      k8s/helm/apigwws/templates/configmap.yaml
  90. +102
    -0
      k8s/helm/apigwws/templates/deployment.yaml
  91. +33
    -0
      k8s/helm/apigwws/templates/ingress.yaml
  92. +14
    -0
      k8s/helm/apigwws/templates/ocelot-cm.yaml
  93. +19
    -0
      k8s/helm/apigwws/templates/service.yaml
  94. +64
    -0
      k8s/helm/apigwws/values.yaml
  95. +47
    -0
      k8s/helm/app.yaml
  96. +21
    -0
      k8s/helm/basket-api/.helmignore
  97. +5
    -0
      k8s/helm/basket-api/Chart.yaml
  98. +8
    -0
      k8s/helm/basket-api/templates/NOTES.txt
  99. +32
    -0
      k8s/helm/basket-api/templates/_helpers.tpl
  100. +52
    -0
      k8s/helm/basket-api/templates/_names.tpl

+ 1
- 3
.dockerignore View File

@ -28,9 +28,7 @@ cli-linux
**/obj/
**/node_modules/
**/bower_components/
**/wwwroot/lib/
!**/wwwroot/lib/signalr/*
!**/wwwroot/lib/toastr/*
**/wwwroot/lib/*
global.json
**/appsettings.localhost.json
src/Web/WebSPA/wwwroot/

+ 7
- 0
.gitignore View File

@ -25,6 +25,10 @@ bld/
# Visual Studio 2015 cache/options directory
.vs/
# .js files created on build:
src/Web/WebMVC/wwwroot/js/site*
# Uncomment if you have tasks that create the project's static files in wwwroot
**/wwwroot/lib/
!/wwwroot/lib/signalr
@ -263,3 +267,6 @@ pub/
/src/Web/WebMVC/wwwroot/css/site.min.css
**/.kube/**
.mfractor
# Ignore HealthCheckdb
*healthchecksdb*

+ 67
- 0
CONTRIBUTING.md View File

@ -0,0 +1,67 @@
# How to contribute to eShopOnContainers
This repo is a reference and learning resource and everyone is invited to contribute, however not all PRs will be accepted into the main branch (**`dev`**).
There's a general development strategy that's driven by @CESARDELATORRE, who chooses, or defines criteria for choosing, the issues to include in the codebase, given a bunch of constraints and other guidelines.
However you can always get in touch with him, if you want to implement some general-interest feature in your repo and have it referenced from the [documentation](https://docs.microsoft.com/dotnet/standard/microservices-architecture/) or the [Microservices eBook](https://aka.ms/microservicesebook/).
## Coding Standards
There are no explicit coding standards so pay attention to the general coding style, that's (mostly) used everywhere.
However, there's only one **REALLY** important rule: **use spaces for indenting** 😉.
## Development Process
In order to help manage community contributions and avoid conflicts, there's a [Development project](https://github.com/dotnet-architecture/eShopOnContainers/projects/3) in this repo, to track assignments to any significant development effort.
Great but... **what's "significant"**?
That's not too easy to define and there are no clear criteria right now but, probably, changing "a couple" lines of code in one file would not qualify while changing "a bunch" of files would.
We'll all be learning in the process so we'll figure it out somehow.
### General Steps
1. Issues are managed as usual with the regular issues list, just like any other repo.
2. Once an issue is marked as a bug, enhancement, new feature or whatever needs development work, it will be labeled as a **backlog-item** and included as the last item in the Backlog project column.
3. Community members can propose themselves to code an issue.
4. @CESARDELATORRE/collaborators will prioritize the backlog items and arrange them in the **Backlog** column, so that the items in the top of the list are implemented first.
5. @CESARDELATORRE/collaborators will review the issues and select the ones approved to begin development with, and move them to the **Approved** column.
6. Issues in the **Approved** column can be assigned to a **collaborator** or to a **community member** who would then begin working on the issue and submit a PR as usual.
## Tests
There's not a tests policy in the project at this moment, but it'll be greatly appreciated if you include them within the [updated test structure](./test/readme.md).
## Forks and Branches
All contributions must be submitted as a [Pull Request (PR)](https://help.github.com/articles/about-pull-requests/) so you need to [fork this repo](https://help.github.com/articles/fork-a-repo/) on your GitHub account.
The main branches are **`dev`** and **`master`**:
- **`dev`**: Contains the latest code **and it is the branch actively developed**.
**All PRs must be against `dev` branch to be considered**. This branch is developed using .NET Core 2.x
- **`master`**: Synced from time to time from **`dev`**. It contains "stable" code.
(**Keep in mind "stable" does not mean PRODUCTION-READY!**)
- Any other branch is considered temporary and could be deleted at any time. Do not submit any PR to them!
## DISCLAIMER - This is not a PRODUCTION-READY TEMPLATE for microservices
eShopOnContainers is a reference application to **showcase architectural patterns** for developing microservices applications on .NET Core. **IT IS NOT A PRODUCTION-READY TEMPLATE** to start real-world application. In fact, the application is in a **permanent beta state**, as it’s also used to test new potentially interesting technologies as they show up.
Since this is a learning resource, some design decisions have favored simplicity to convey a pattern, over production-grade robustness.
## Suggestions
We hope this helps us all to work better and avoid some of the problems/frustrations of working in such a large community.
We'd also appreciate any comments or ideas to improve this.

+ 3
- 0
NuGet.config View File

@ -4,6 +4,9 @@
<add key="repositoryPath" value="packages" />
</config>
<packageSources>
<add key="Preview-aspnetcore-tools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json"/>
<add key="Preview-aspnetcore-dev" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json"/>
<add key="Preview-aspnetcore" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json"/>
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnet-feb2017-patch/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>

+ 78
- 15
README.md View File

@ -1,30 +1,93 @@
# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**BETA state** - Visual Studio 2017 and CLI environments compatible)
Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
## Linux Build Status for 'dev' branch
Dev branch contains the latest "stable" code, and their images are tagged with `:dev` in our [Docker Hub](https://cloud.docker.com/u/eshop/repository/list):
Api Gateways base image
[![Api Gateways base image](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/apigws?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=201&branchName=dev)
Basket API
[![Basket API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/basket?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=199&branchName=dev)
Catalog API
[![Catalog API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/catalog?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=197&branchName=dev)
Identity API
[![Identity API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/identity?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=200&branchName=dev)
Location API
[![Location API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/location?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=202&branchName=dev)
Marketing API
[![Marketing API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/marketing?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=203&branchName=dev)
Ordering API
[![Ordering API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/ordering?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=198&branchName=dev)
Payment API
[![Payment API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/payment?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=205&branchName=dev)
Webhooks API
[![Webhooks API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=207&branchName=dev)
Web Shopping Aggregator
[![Web Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/web-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=206&branchName=dev)
Mobile Shopping Aggregator
[![Mobile Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/mobile-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=204&branchName=dev)
Webbhooks demo client
[![Webhooks demo client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks-client?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=208&branchName=dev)
WebMVC Client
[![WebMVC Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webmvc?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=209&branchName=dev)
WebSPA Client
[![WebSPA Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webspa?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=210&branchName=dev)
Web Status
[![Web Status](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webstatus?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=211&branchName=dev)
## IMPORTANT NOTES!
**The current supported Visual Studio version for eShopOnContainers is Visual Studio 2017 15.7** ([GA/RTM since May 8th 2018](https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes)) or later version.
**You can use either the latest version of Visual Studio or simply Docker CLI and .NET CLI for Windows, Mac and Linux**.
**Note for Pull Requests (PRs)**: We accept pull request from the community. When doing it, please do it onto the **DEV branch** which is the consolidated work-in-progress branch. Do not request it onto Master branch, if possible.
**NEWS / ANNOUNCEMENTS**
Do you want to be up-to-date on .NET Architecture guidance and reference apps like eShopOnContainers? --> Subscribe by "WATCHING" this new GitHub repo: https://github.com/dotnet-architecture/News
## Updated for .NET Core 2.0 "wave" of technologies
eShopOnContainers is updated to .NET Core 2.0 "wave". Not just compilation but also new recommended code in EF Core 2.0, ASP.NET Core 2.0, and other new related versions.
## Updated for .NET Core 2.2 "wave" of technologies
eShopOnContainers is updated to .NET Core 2.x (currently updated to 2.2) "wave" of technologies. Not just compilation but also new recommended code in EF Core, ASP.NET Core, and other new related versions.
The **dockerfiles** in the solution have also been updated and now support [**Docker Multi-Stage**](https://blogs.msdn.microsoft.com/stevelasker/2017/09/11/net-and-multistage-dockerfiles/) since mid-December 2017.
For a list on the new .NET Core 2.0 related implemented features, see this [blog post](https://blogs.msdn.microsoft.com/dotnet/2017/08/02/microservices-and-docker-containers-architecture-patterns-and-development-guidance/).
>**PLEASE** Read our [branch guide](./branch-guide.md) to know about our branching policy
> ### DISCLAIMER
> **IMPORTANT:** The current state of this sample application is **BETA**, because we are constantly evolving towards new released technologies. Therefore, many areas could be improved and change significantly while refactoring current code and implementing new features. Feedback with improvements and pull requests from the community will be highly appreciated and accepted.
> **IMPORTANT:** The current state of this sample application is **BETA**, because we are constantly evolving towards newly released technologies. Therefore, many areas could be improved and change significantly while refactoring the current code and implementing new features. Feedback with improvements and pull requests from the community will be highly appreciated and accepted.
>
> This reference application proposes a simplified microservice oriented architecture implementation to introduce technologies like .NET Core with Docker containers through a comprehensive application. The chosen domain is an eShop/eCommerce but simply because it is a well-know domain by most people/developers.
However, this sample application should not be considered as an "eCommerce reference model", at all. The implemented business domain might not be ideal from an eCommerce business point of view. It is neither trying to solve all the problems in a large, scalable and mission-critical distributed system. It is just a bootstrap for developers to easily get started in the world of Docker containers and microservices with .NET Core.
> This reference application proposes a simplified microservice oriented architecture implementation to introduce technologies like .NET Core with Docker containers through a comprehensive application. The chosen domain is eShop/eCommerce but simply because it is a well-known domain by most people/developers.
However, this sample application should not be considered as an "eCommerce reference model" at all. The implemented business domain might not be ideal from an eCommerce business point of view. It is neither trying to solve all the problems in a large, scalable and mission-critical distributed system. It is just a bootstrap for developers to easily get started in the world of Docker containers and microservices with .NET Core.
> <p>For example, the next step after running the solution in the local dev PC and understanding Docker containers and microservices development with .NET Core, is to select a microservice cluster/orchestrator like Kubernetes in Azure (AKS) or Azure Service Fabric, both environments tested and supported by this solution.
> Additional steps would be to move your databases to HA cloud services (like Azure SQL Database), or switch your EventBus to use Azure Service Bus (instead of bare-bone RabbitMQ) or any other production ready Service Bus in the market.
> Additional steps would be to move your databases to HA cloud services (like Azure SQL Database) or switch your EventBus to use Azure Service Bus (instead of bare-bone RabbitMQ) or any other production-ready Service Bus in the market.
![image](https://user-images.githubusercontent.com/1712635/40397331-059a7ec6-5de7-11e8-8542-a597eca16fef.png)
@ -41,7 +104,7 @@ The architecture proposes a microservice oriented architecture implementation wi
> ### Important Note on API Gateways and published APIs
> Since April 2018, we have introduced the implementation of the [API Gateway pattern](http://microservices.io/patterns/apigateway.html) and [Backend-For-Front-End (BFF) pattern](https://samnewman.io/patterns/architectural/bff/) in eShopOnContainers architecture, so you can filter and publish simplified APIs and URIs and apply additional security in that tier while hiding/securing the internal microservices to the client apps or outside consumers. These sample API Gateways in eShopOnContainers are based on [Ocelot](https://github.com/ThreeMammals/Ocelot), an OSS lightweight API Gateway solution explained [here](http://threemammals.com/ocelot). The deployed API Gateways are autonomous and can be deployed as your own custom microservices/containers, as it is currently done in eShopOnContainers, so you can test it even in a simple development environment with just Docker engine or deploy it into orchestrators like Kubernetes in AKS or Service Fabric.
> For your production-ready architecture you can either keep using [Ocelot](https://github.com/ThreeMammals/Ocelot) which is simple and easy to use and used in production by significant companies or if you need further functionality and a much richer set of features suittable for commercial APIs, you can also substitute those API Gateways and use [Azure API Management](https://azure.microsoft.com/en-us/services/api-management/) or any other commercial API Gateway, as shown in the following image.
> For your production-ready architecture you can either keep using [Ocelot](https://github.com/ThreeMammals/Ocelot) which is simple and easy to use and used in production by significant companies or if you need further functionality and a much richer set of features suitable for commercial APIs, you can also substitute those API Gateways and use [Azure API Management](https://azure.microsoft.com/en-us/services/api-management/) or any other commercial API Gateway, as shown in the following image.
<p>
<img src="img/eShopOnContainers-Architecture-With-Azure-API-Management.png">
@ -58,9 +121,9 @@ The architecture proposes a microservice oriented architecture implementation wi
<p>
> ### Important Note on Database Servers/Containers
> In this solution's current configuration for a development environment, the SQL databases are automatically deployed with sample data into a single SQL Server container (a single shared Docker container for SQL databases) so the whole solution can be up and running without any dependency to any cloud or specific server. Each database could also be deployed as a single Docker container, but then you'd need more than 8GB of RAM assigned to Docker in your development machine in order to be able to run 3 SQL Server Docker containers in your Docker Linux host in "Docker for Windows" or "Docker for Mac" development environments.
> In this solution's current configuration for a development environment, the SQL databases are automatically deployed with sample data into a single SQL Server container (a single shared Docker container for SQL databases) so the whole solution can be up and running without any dependency to any cloud or a specific server. Each database could also be deployed as a single Docker container, but then you'd need more than 8GB of RAM assigned to Docker in your development machine in order to be able to run 3 SQL Server Docker containers in your Docker Linux host in "Docker for Windows" or "Docker for Mac" development environments.
> <p> A similar case is defined in regard to Redis cache running as a container for the development environment. Or a No-SQL database (MongoDB) running as a container.
> <p> However, in a real production environment it is recommended to have your databases (SQL Server, Redis, and the NO-SQL database, in this case) in HA (High Available) services like Azure SQL Database, Redis as a service and Azure CosmosDB instead the MongoDB container (as both systems share the same access protocol). If you want to change to a production configuration, you'll just need to change the connection strings once you have set up the servers in a HA cloud or on-premises.
> <p> However, in a real production environment it is recommended to have your databases (SQL Server, Redis, and the NO-SQL database, in this case) in HA (High Available) services like Azure SQL Database, Redis as a service and Azure CosmosDB instead the MongoDB container (as both systems share the same access protocol). If you want to change to a production configuration, you'll just need to change the connection strings once you have set up the servers in an HA cloud or on-premises.
## Related documentation and guidance
While developing this reference application, we've been creating a reference <b>Guide/eBook</b> focusing on <b>architecting and developing containerized and microservice based .NET Applications</b> (download link available below) which explains in detail how to develop this kind of architectural style (microservices, Docker containers, Domain-Driven Design for certain microservices) plus other simpler architectural styles, like monolithic apps that can also live as Docker containers.
@ -72,18 +135,18 @@ You can download them and start reviewing these Guides/eBooks here:
| Architecting & Developing | Containers Lifecycle & CI/CD | App patterns with Xamarin.Forms |
| ------------ | ------------| ------------|
| <a href='https://aka.ms/microservicesebook'><img src="img/ebook_arch_dev_microservices_containers_cover.png"> </a> | <a href='https://aka.ms/dockerlifecycleebook'> <img src="img/ebook_containers_lifecycle.png"> </a> | <a href='https://aka.ms/xamarinpatternsebook'> <img src="img/xamarin-enterprise-patterns-ebook-cover-small.png"> </a> |
| <sup> <a href='https://aka.ms/microservicesebook'>**Download .PDF** (2nd Edition)</a> </sup> | <sup> <a href='https://aka.ms/dockerlifecycleebook'>**Download** </a> </sup> | <sup> <a href='https://aka.ms/xamarinpatternsebook'>**Download** </a> </sup> |
| <sup> <a href='https://aka.ms/microservicesebook'>**Download .PDF** (v2.2 Edition)</a> </sup> | <sup> <a href='https://aka.ms/dockerlifecycleebook'>**Download** </a> </sup> | <sup> <a href='https://aka.ms/xamarinpatternsebook'>**Download** </a> </sup> |
Download in other formats (**eReaders** like **MOBI**, **EPUB**) and other eBooks at the [.NET Architecture center](http://dot.net/architecture).
Send feedback to [dotnet-architecture-ebooks-feedback@service.microsoft.com](dotnet-architecture-ebooks-feedback@service.microsoft.com)
However, we encourage to download and review the [Architecting and Developing Microservices eBook](https://aka.ms/microservicesebook) because the architectural styles and architectural patterns and technologies explained in the guidance are using this reference application when explaining many pattern implementations, so you'll understand much better the context, design and decisions taken in the current architecture and internal designs.
However, we encourage you to download and review the [Architecting and Developing Microservices eBook](https://aka.ms/microservicesebook) because the architectural styles and architectural patterns and technologies explained in the guide are using this reference application when explaining many pattern implementations, so you'll understand the context, design and decisions taken in the current architecture and internal designs much better.
## Overview of the application code
In this repo you can find a sample reference application that will help you to understand how to implement a microservice architecture based application using <b>.NET Core</b> and <b>Docker</b>.
The example business domain or scenario is based on an eShop or eCommerce which is implemented as a multi-container application. Each container is a microservice deployment (like the basket-microservice, catalog-microservice, ordering-microservice and the identity-microservice) which are developed using ASP.NET Core running on .NET Core so they can run either on Linux Containers and Windows Containers.
The example business domain or scenario is based on an eShop or eCommerce which is implemented as a multi-container application. Each container is a microservice deployment (like the basket-microservice, catalog-microservice, ordering-microservice and the identity-microservice) which is developed using ASP.NET Core running on .NET Core so they can run either on Linux Containers and Windows Containers.
The screenshot below shows the VS Solution structure for those microservices/containers and client apps.
- (*Recommended when getting started*) Open <b>eShopOnContainers-ServicesAndWebApps.sln</b> for a solution containing just the server-side projects related to the microservices and web applications.


+ 50
- 0
build/azure-devops/apigws/azure-pipelines.yml View File

@ -0,0 +1,50 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/ApiGateways/*
- k8s/helm/apigwmm/*
- k8s/helm/apigwms/*
- k8s/helm/apigwwm/*
- k8s/helm/apigwws/*
exclude:
- src/ApiGateways/Mobile.Bff.Shopping/aggregator/*
- src/ApiGateways/Web.Bff.Shopping/aggregator/*
steps:
- task: DockerCompose@0
displayName: Compose build apigws
inputs:
dockerComposeCommand: 'build mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push apigws
inputs:
dockerComposeCommand: 'push mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/basket-api/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Services/Basket/*
- k8s/helm/basket-api/*
steps:
- task: DockerCompose@0
displayName: Compose build basket
inputs:
dockerComposeCommand: 'build basket.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push basket
inputs:
dockerComposeCommand: 'push basket.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/catalog-api/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Services/Catalog/*
- k8s/helm/catalog-api/*
steps:
- task: DockerCompose@0
displayName: Compose build catalog
inputs:
dockerComposeCommand: 'build catalog.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push catalog
inputs:
dockerComposeCommand: 'push catalog.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/identity-api/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Services/Identity/*
- k8s/helm/identity-api/*
steps:
- task: DockerCompose@0
displayName: Compose build identity
inputs:
dockerComposeCommand: 'build identity.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push identity
inputs:
dockerComposeCommand: 'push identity.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/location-api/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Services/Location/*
- k8s/helm/locations-api/*
steps:
- task: DockerCompose@0
displayName: Compose build locations
inputs:
dockerComposeCommand: 'build locations.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push locations
inputs:
dockerComposeCommand: 'push locations.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/marketing-api/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Services/Marketing/*
- k8s/helm/marketing-api/*
steps:
- task: DockerCompose@0
displayName: Compose build marketing
inputs:
dockerComposeCommand: 'build marketing.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push marketing
inputs:
dockerComposeCommand: 'push marketing.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 44
- 0
build/azure-devops/mobile-shopping-agg/azure-pipelines.yml View File

@ -0,0 +1,44 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/ApiGateways/Mobile.Bff.Shopping/aggregator/*
- k8s/helm/mobileshoppingagg/*
steps:
- task: DockerCompose@0
displayName: Compose build mobileshoppingagg
inputs:
dockerComposeCommand: 'build mobileshoppingagg'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push mobileshoppingagg
inputs:
dockerComposeCommand: 'push mobileshoppingagg'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 47
- 0
build/azure-devops/ordering-api/azure-pipelines.yml View File

@ -0,0 +1,47 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Services/Ordering/*
- k8s/helm/ordering-api/*
- k8s/helm/ordering-backgroundtasks/*
- k8s/helm/ordering-signalrhub/*
steps:
- task: DockerCompose@0
displayName: Compose build ordering
inputs:
dockerComposeCommand: 'build ordering.api ordering.backgroundtasks ordering.signalrhub'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push ordering
inputs:
dockerComposeCommand: 'push ordering.api ordering.backgroundtasks ordering.signalrhub'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/payment-api/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Services/Payment/*
- k8s/helm/payment-api/*
steps:
- task: DockerCompose@0
displayName: Compose build payment
inputs:
dockerComposeCommand: 'build payment.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push payment
inputs:
dockerComposeCommand: 'push payment.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 5
- 0
build/azure-devops/readme.md View File

@ -0,0 +1,5 @@
# Azure Devops build definitions
This folder contains the Azure Devops build definitions in YAML format. Each folder contains one `azure-pipelines.yml` that contains the build definition for one microservice (usually a Docker image, but some microservices generates more than one Docker image).
For more information about YAML builds read the [Azure DevOps documentation](https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started-yaml?view=azure-devops).

+ 44
- 0
build/azure-devops/web-shopping-agg/azure-pipelines.yml View File

@ -0,0 +1,44 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/ApiGateways/Web.Bff.Shopping/aggregator/*
- k8s/helm/webshoppingagg/*
steps:
- task: DockerCompose@0
displayName: Compose build webshoppingagg
inputs:
dockerComposeCommand: 'build webshoppingagg'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webshoppingagg
inputs:
dockerComposeCommand: 'push webshoppingagg'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/webhooks-api/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Services/Webhooks/*
- k8s/helm/webhooks-api/*
steps:
- task: DockerCompose@0
displayName: Compose build webhooks
inputs:
dockerComposeCommand: 'build webhooks.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webhooks
inputs:
dockerComposeCommand: 'push webhooks.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/webhooks-client/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Web/WebhookClient/*
- k8s/helm/webhooks-web/*
steps:
- task: DockerCompose@0
displayName: Compose build webhooks.client
inputs:
dockerComposeCommand: 'build webhooks.client'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webhooks.client
inputs:
dockerComposeCommand: 'push webhooks.client'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/webmvc/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Web/WebMVC/*
- k8s/helm/webmvc/*
steps:
- task: DockerCompose@0
displayName: Compose build webmvc
inputs:
dockerComposeCommand: 'build webmvc'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webmvc
inputs:
dockerComposeCommand: 'push webmvc'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/webspa/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Web/WebSPA/*
- k8s/helm/webspa/*
steps:
- task: DockerCompose@0
displayName: Compose build webspa
inputs:
dockerComposeCommand: 'build webspa'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webspa
inputs:
dockerComposeCommand: 'push webspa'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 45
- 0
build/azure-devops/webstatus/azure-pipelines.yml View File

@ -0,0 +1,45 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Web/WebStatus/*
- k8s/helm/webstatus/*
steps:
- task: DockerCompose@0
displayName: Compose build webstatus
inputs:
dockerComposeCommand: 'build webstatus'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webstatus
inputs:
dockerComposeCommand: 'push webstatus'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm

+ 1
- 1
cli-windows/build-images.ps1 View File

@ -8,4 +8,4 @@ if ([string]::IsNullOrEmpty($imageTag)) {
Write-Host "Building images with tag $imageTag" -ForegroundColor Yellow
$env:TAG=$imageTag
docker-compose -f "$scriptPath\..\docker-compose.yml" build
docker-compose -f "$scriptPath\..\docker-compose.yml" -f "$scriptPath\..\docker-compose.windows.yml" build

+ 3
- 2
cli-windows/start-windows-containers.ps1 View File

@ -23,10 +23,11 @@ if ($buildBits) {
$env:ESHOP_EXTERNAL_DNS_NAME_OR_IP = "10.0.75.1"
$env:ESHOP_AZURE_STORAGE_CATALOG_URL ="http://10.0.75.1:5101/api/v1/catalog/items/[0]/pic/"
$env:ESHOP_AZURE_STORAGE_MARKETING_URL ="http://10.0.75.1:5110/api/v1/campaigns/[0]/pic/"
$env:ESHOP_OCELOT_VOLUME_SPEC ="C:\app\configuration"
if (-Not $customEventBusLoginPassword) {
docker-compose -f "$rootPath\docker-compose-windows.yml" -f "$rootPath\docker-compose.override.yml" -f "$rootPath\docker-compose.override.windows.yml" up
docker-compose -f "$rootPath\docker-compose.yml" -f "$rootPath\docker-compose.override.yml" -f "$rootPath\docker-compose.windows.yml" -f "$rootPath\docker-compose.override.windows.yml" up
}
else {
docker-compose -f "$rootPath\docker-compose-windows.yml" -f "$rootPath\docker-compose.override.yml" up
docker-compose -f "$rootPath\docker-compose.yml" -f "$rootPath\docker-compose.override.yml" -f "$rootPath\docker-compose.windows.yml" up
}

+ 2
- 2
deploy/az/servicebus/readme.md View File

@ -8,7 +8,7 @@ The ARM template `sbusdeploy.json` and its parameter file (`sbusdeploy.parameter
## Editing sbusdeploy.parameters.json file
You can edit the `sbusdeploy.parameters.parameters.json` file to set your values, but is not needed. The only parameter than can
You can edit the `sbusdeploy.parameters.json` file to set your values, but is not needed. The only parameter than can
be set is:
1. `namespaceprefix` is a string that is used to create the namespace. ARM script creates unique values by appending a unique string to this parameter value, so you can leave the default value.
@ -21,4 +21,4 @@ i. e. if you are in windows, to deploy servicebus in a new resourcegroup located
```
create-resources.cmd servicebus\sbusdeploy newResourceGroup -c westus
```
```

+ 247
- 0
docker-compose-tests.override.yml View File

@ -0,0 +1,247 @@
version: '3.4'
services:
rabbitmq-test:
ports:
- "15672:15672"
- "5672:5672"
sql-data-test:
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "5433:1433"
nosql-data-test:
ports:
- "27017:27017"
basket-data-test:
ports:
- "6379:6379"
identity-api-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104
- XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105/xamarincallback
- ConnectionString=${ESHOP_AZURE_IDENTITY_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word}
- MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100
- LocationApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5109
- MarketingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5110
- BasketApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103
- OrderingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102
- MobileShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5120
- WebShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5121
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5105:80"
basket-api-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_REDIS_BASKET_DB:-basket-data-test}
- identityUrl=http://identity-api
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- AzureServiceBusEnabled=False
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5103:80"
entrypoint:
- dotnet
- test
- --logger
- trx;LogFileName=/tests/basket-test-results.xml
basket-api-unit-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_REDIS_BASKET_DB:-basket-data-test}
- identityUrl=http://identity-api
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- AzureServiceBusEnabled=False
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5113:80"
entrypoint:
- dotnet
- test
- --logger
- trx;LogFileName=/tests/basket-unit-test-results.xml
catalog-api-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word}
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/api/v1/c/catalog/items/[0]/pic/}
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- AzureStorageAccountName=${ESHOP_AZURE_STORAGE_CATALOG_NAME}
- AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_CATALOG_KEY}
- UseCustomizationData=True
- AzureServiceBusEnabled=False
- AzureStorageEnabled=False
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5101:80"
entrypoint:
- dotnet
- test
- --logger
- trx;LogFileName=/tests/catalog-test-results.xml
catalog-api-unit-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word}
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/api/v1/c/catalog/items/[0]/pic/}
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- AzureStorageAccountName=${ESHOP_AZURE_STORAGE_CATALOG_NAME}
- AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_CATALOG_KEY}
- UseCustomizationData=True
- AzureServiceBusEnabled=False
- AzureStorageEnabled=False
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5191:80"
entrypoint:
- dotnet
- test
- --logger
- trx;LogFileName=/tests/catalog-unit-test-results.xml
ordering-api-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_ORDERING_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word}
- identityUrl=http://identity-api
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- UseCustomizationData=True
- AzureServiceBusEnabled=False
- CheckUpdateTime=30000
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5102:80"
entrypoint:
- dotnet
- test
- --logger
- trx;LogFileName=/tests/ordering-test-results.xml
ordering-api-unit-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_ORDERING_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word}
- identityUrl=http://identity-api
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- UseCustomizationData=True
- AzureServiceBusEnabled=False
- CheckUpdateTime=30000
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5112:80"
entrypoint:
- dotnet
- test
- --logger
- trx;LogFileName=/tests/ordering-unit-test-results.xml
marketing-api-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_MARKETING_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.MarketingDb;User Id=sa;Password=Pass@word}
- MongoConnectionString=${ESHOP_AZURE_COSMOSDB:-mongodb://nosql-data-test}
- MongoDatabase=MarketingDb
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- identityUrl=http://identity-api
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
- CampaignDetailFunctionUri=${ESHOP_AZUREFUNC_CAMPAIGN_DETAILS_URI}
- PicBaseUrl=${ESHOP_AZURE_STORAGE_MARKETING_URL:-http://localhost:5110/api/v1/campaigns/[0]/pic/}
- AzureStorageAccountName=${ESHOP_AZURE_STORAGE_MARKETING_NAME}
- AzureStorageAccountKey=${ESHOP_AZURE_STORAGE_MARKETING_KEY}
- AzureServiceBusEnabled=False
- AzureStorageEnabled=False
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5110:80"
entrypoint:
- dotnet
- test
- --logger
- trx;LogFileName=/tests/marketing-test-results.xml
payment-api-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- AzureServiceBusEnabled=False
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5108:80"
locations-api-test:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_COSMOSDB:-mongodb://nosql-data-test}
- Database=LocationsDb
- identityUrl=http://identity-api
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- AzureServiceBusEnabled=False
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5109:80"
entrypoint:
- dotnet
- test
- --logger
- trx;LogFileName=/tests/locations-test-results.xml

+ 130
- 0
docker-compose-tests.yml View File

@ -0,0 +1,130 @@
version: '3.4'
services:
rabbitmq-test:
image: rabbitmq:3-management-alpine
basket-data-test:
image: redis:alpine
sql-data-test:
image: microsoft/mssql-server-linux:2017-latest
nosql-data-test:
image: mongo
identity-api-test:
image: ${REGISTRY:-eshop}/identity-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Identity/Identity.API/Dockerfile
depends_on:
- sql-data-test
basket-api-test:
image: ${REGISTRY:-eshop}/basket-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Basket/Basket.API/Dockerfile
target: functionaltest
depends_on:
- basket-data-test
- identity-api-test
- rabbitmq-test
volumes:
- ${BUILD_ARTIFACTSTAGINGDIRECTORY:-./tests-results/}:/tests
basket-api-unit-test:
image: ${REGISTRY:-eshop}/basket-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Basket/Basket.API/Dockerfile
target: unittest
depends_on:
- basket-data-test
- identity-api-test
- rabbitmq-test
volumes:
- ${BUILD_ARTIFACTSTAGINGDIRECTORY:-./tests-results/}:/tests
catalog-api-test:
image: ${REGISTRY:-eshop}/catalog-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Catalog/Catalog.API/Dockerfile
target: functionaltest
depends_on:
- sql-data-test
- rabbitmq-test
volumes:
- ${BUILD_ARTIFACTSTAGINGDIRECTORY:-./tests-results/}:/tests
catalog-api-unit-test:
image: ${REGISTRY:-eshop}/catalog-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Catalog/Catalog.API/Dockerfile
target: unittest
depends_on:
- sql-data-test
- rabbitmq-test
volumes:
- ${BUILD_ARTIFACTSTAGINGDIRECTORY:-./tests-results/}:/tests
ordering-api-test:
image: ${REGISTRY:-eshop}/ordering-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.API/Dockerfile
target: functionaltest
depends_on:
- sql-data-test
- rabbitmq-test
volumes:
- ${BUILD_ARTIFACTSTAGINGDIRECTORY:-./tests-results/}:/tests
ordering-api-unit-test:
image: ${REGISTRY:-eshop}/ordering-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.API/Dockerfile
target: unittest
depends_on:
- sql-data-test
- rabbitmq-test
volumes:
- ${BUILD_ARTIFACTSTAGINGDIRECTORY:-./tests-results/}:/tests
marketing-api-test:
image: ${REGISTRY:-eshop}/marketing-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Marketing/Marketing.API/Dockerfile
target: functionaltest
depends_on:
- sql-data-test
- nosql-data-test
- identity-api-test
- rabbitmq-test
volumes:
- ${BUILD_ARTIFACTSTAGINGDIRECTORY:-./tests-results/}:/tests
payment-api-test:
image: ${REGISTRY:-eshop}/payment-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Payment/Payment.API/Dockerfile
depends_on:
- rabbitmq-test
locations-api-test:
image: ${REGISTRY:-eshop}/locations-api-test:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Location/Locations.API/Dockerfile
target: functionaltest
depends_on:
- nosql-data-test
- rabbitmq-test
volumes:
- ${BUILD_ARTIFACTSTAGINGDIRECTORY:-./tests-results/}:/tests

+ 0
- 138
docker-compose-windows.yml View File

@ -1,138 +0,0 @@
version: '3.4'
services:
basket.api:
image: eshop/basket.api-win:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Basket/Basket.API/Dockerfile
depends_on:
- basket.data
- identity.api
- rabbitmq
catalog.api:
image: eshop/catalog.api-win:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Catalog/Catalog.API/Dockerfile
depends_on:
- sql.data
- rabbitmq
identity.api:
image: eshop/identity.api-win:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Identity/Identity.API/Dockerfile
depends_on:
- sql.data
ordering.api:
image: eshop/ordering.api-win:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.API/Dockerfile
depends_on:
- sql.data
- rabbitmq
ordering.backgroundtasks:
image: eshop/ordering.backgroundtasks-win:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile
depends_on:
- sql.data
- rabbitmq
ordering.signalrhub:
image: eshop/ordering.signalrhub:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.SignalrHub/Dockerfile
depends_on:
- sql.data
- identity.api
- rabbitmq
marketing.api:
image: eshop/marketing.api-win:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Marketing/Marketing.API/Dockerfile
depends_on:
- sql.data
- nosql.data
- identity.api
- rabbitmq
webspa:
image: eshop/webspa-win:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebSPA/Dockerfile
depends_on:
- catalog.api
- ordering.api
- identity.api
- basket.api
- marketing.api
webmvc:
image: eshop/webmvc-win:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebMVC/Dockerfile
depends_on:
- catalog.api
- ordering.api
- identity.api
- basket.api
- marketing.api
webstatus:
image: eshop/webstatus-win:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebStatus/Dockerfile
payment.api:
image: eshop/payment.api-win:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Payment/Payment.API/Dockerfile
depends_on:
- rabbitmq
locations.api:
image: eshop/locations.api-win:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Location/Locations.API/Dockerfile
depends_on:
- nosql.data
- rabbitmq
sql.data:
image: microsoft/mssql-server-windows-developer
nosql.data:
image: mongo:windowsservercore
basket.data:
image: redis:nanoserver
ports:
- "6379:6379"
rabbitmq:
image: spring2/rabbitmq
ports:
- "15672:15672"
- "5672:5672"
networks:
default:
external:
name: nat

+ 2
- 7
docker-compose.override.windows.yml View File

@ -37,11 +37,6 @@ services:
- EventBusUserName=admin
- EventBusPassword=password
ordering.api:
environment:
- EventBusUserName=admin
- EventBusPassword=password
ordering.backgroundtasks:
environment:
- EventBusUserName=admin
@ -58,6 +53,6 @@ services:
- EventBusPassword=password
ordering.signalrhub:
environment:
environment:
- EventBusUserName=admin
- EventBusPassword=password
- EventBusPassword=password

+ 200
- 106
docker-compose.override.yml View File

@ -7,7 +7,54 @@ version: '3.4'
# An external IP or DNS name has to be used (instead localhost and the 10.0.75.1 IP) when testing the Web apps and the Xamarin apps from remote machines/devices using the same WiFi, for instance.
services:
seq:
environment:
- ACCEPT_EULA=Y
ports:
- "5340:80"
sql.data:
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "5433:1433" # Important: In a production environment your should remove the external port
nosql.data:
ports:
- "27017:27017" # Important: In a production environment your should remove the external port
basket.data:
ports:
- "6379:6379" # Important: In a production environment your should remove the external port
rabbitmq:
ports:
- "15672:15672" # Important: In a production environment your should remove the external port
- "5672:5672" # Important: In a production environment your should remove the external port
identity.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104
- XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105/xamarincallback #localhost do not work for UWP login, so we have to use "external" IP always
- ConnectionString=${ESHOP_AZURE_IDENTITY_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word}
- MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your local dev-machine firewall at range 5100-5110.
- LocationApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5109
- MarketingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5110
- BasketApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103
- OrderingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102
- MobileShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5120
- WebShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5121
- WebhooksApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5113
- WebhooksWebClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5114
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5105:80"
basket.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
@ -47,26 +94,6 @@ services:
- "5101:80" # Important: In a production environment your should remove the external port (5101) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
identity.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104
- XamarinCallback=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105/xamarincallback #localhost do not work for UWP login, so we have to use "external" IP always
- ConnectionString=${ESHOP_AZURE_IDENTITY_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word}
- MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your local dev-machine firewall at range 5100-5110.
- LocationApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5109
- MarketingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5110
- BasketApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103
- OrderingApiClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102
- MobileShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5120
- WebShoppingAggClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5121
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5105:80"
ordering.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
@ -80,7 +107,6 @@ services:
- UseCustomizationData=True
- AzureServiceBusEnabled=False
- CheckUpdateTime=30000
- GracePeriodTime=1
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
@ -132,66 +158,6 @@ services:
- "5110:80" # Important: In a production environment your should remove the external port (5110) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
webspa:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
- PurchaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
- MarketingUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5203
- CatalogUrlHC=http://catalog.api/hc
- OrderingUrlHC=http://ordering.api/hc
- IdentityUrlHC=http://identity.api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser.
- BasketUrlHC=http://basket.api/hc
- MarketingUrlHC=http://marketing.api/hc
- PaymentUrlHC=http://payment.api/hc
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
ports:
- "5104:80"
webmvc:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- PurchaseUrl=http://webshoppingapigw
- IdentityUrl=http://10.0.75.1:5105 # Local Mac: Use http://docker.for.mac.localhost:5105 || Local Windows: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser. || #Remote access: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser.
- MarketingUrl=http://webmarketingapigw
- CatalogUrlHC=http://catalog.api/hc
- OrderingUrlHC=http://ordering.api/hc
- IdentityUrlHC=http://identity.api/hc #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser.
- BasketUrlHC=http://basket.api/hc
- MarketingUrlHC=http://marketing.api/hc
- PaymentUrlHC=http://payment.api/hc
- SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5100:80"
webstatus:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- CatalogUrl=http://catalog.api/hc
- OrderingUrl=http://ordering.api/hc
- OrderingBackgroundTasksUrl=http://ordering.backgroundtasks/hc
- BasketUrl=http://basket.api/hc
- IdentityUrl=http://identity.api/hc
- LocationsUrl=http://locations.api/hc
- MarketingUrl=http://marketing.api/hc
- PaymentUrl=http://payment.api/hc
- mvc=http://webmvc/hc
- spa=http://webspa/hc
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5107:80"
payment.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
@ -224,63 +190,87 @@ services:
ports:
- "5109:80" # Important: In a production environment your should remove the external port (5109) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
sql.data:
webhooks.api:
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "5433:1433" # Important: In a production environment your should remove the external port
nosql.data:
ports:
- "27017:27017" # Important: In a production environment your should remove the external port
basket.data:
ports:
- "6379:6379" # Important: In a production environment your should remove the external port
rabbitmq:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- ConnectionString=${ESHOP_AZURE_WEBHOOKS_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.WebhooksDb;User Id=sa;Password=Pass@word}
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
- IdentityUrl=http://identity.api
- IdentityUrlExternal=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105
ports:
- "15672:15672" # Important: In a production environment your should remove the external port
- "5672:5672" # Important: In a production environment your should remove the external port
- "5113:80" # Important: In a production environment your should remove the external port (5109) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
mobileshoppingapigw:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- IdentityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
- urls__basket=http://basket.api
- urls__catalog=http://catalog.api
- urls__orders=http://ordering.api
- urls__identity=http://identity.api
- CatalogUrlHC=http://catalog.api/hc
- OrderingUrlHC=http://ordering.api/hc
- IdentityUrlHC=http://identity.api/hc
- BasketUrlHC=http://basket.api/hc
- MarketingUrlHC=http://marketing.api/hc
- PaymentUrlHC=http://payment.api/hc
- LocationUrlHC=http://locations.api/hc
ports:
- "5200:80"
volumes:
- ./src/ApiGateways/Mobile.Bff.Shopping/apigw:/app/configuration
- ./src/ApiGateways/Mobile.Bff.Shopping/apigw:${ESHOP_OCELOT_VOLUME_SPEC:-/app/configuration}
mobilemarketingapigw:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- IdentityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
- CatalogUrlHC=http://catalog.api/hc
- OrderingUrlHC=http://ordering.api/hc
- IdentityUrlHC=http://identity.api/hc
- BasketUrlHC=http://basket.api/hc
- MarketingUrlHC=http://marketing.api/hc
- PaymentUrlHC=http://payment.api/hc
- LocationUrlHC=http://locations.api/hc
ports:
- "5201:80"
volumes:
- ./src/ApiGateways/Mobile.Bff.Marketing/apigw:/app/configuration
- ./src/ApiGateways/Mobile.Bff.Marketing/apigw:${ESHOP_OCELOT_VOLUME_SPEC:-/app/configuration}
webshoppingapigw:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- IdentityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
- CatalogUrlHC=http://catalog.api/hc
- OrderingUrlHC=http://ordering.api/hc
- IdentityUrlHC=http://identity.api/hc
- BasketUrlHC=http://basket.api/hc
- MarketingUrlHC=http://marketing.api/hc
- PaymentUrlHC=http://payment.api/hc
- LocationUrlHC=http://locations.api/hc
ports:
- "5202:80"
volumes:
- ./src/ApiGateways/Web.Bff.Shopping/apigw:/app/configuration
- ./src/ApiGateways/Web.Bff.Shopping/apigw:${ESHOP_OCELOT_VOLUME_SPEC:-/app/configuration}
webmarketingapigw:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- IdentityUrl=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
- CatalogUrlHC=http://catalog.api/hc
- OrderingUrlHC=http://ordering.api/hc
- IdentityUrlHC=http://identity.api/hc
- BasketUrlHC=http://basket.api/hc
- MarketingUrlHC=http://marketing.api/hc
- PaymentUrlHC=http://payment.api/hc
- LocationUrlHC=http://locations.api/hc
ports:
- "5203:80"
volumes:
- ./src/ApiGateways/Web.Bff.Marketing/apigw:/app/configuration
- ./src/ApiGateways/Web.Bff.Marketing/apigw:${ESHOP_OCELOT_VOLUME_SPEC:-/app/configuration}
mobileshoppingagg:
environment:
@ -289,6 +279,13 @@ services:
- urls__catalog=http://catalog.api
- urls__orders=http://ordering.api
- urls__identity=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
- CatalogUrlHC=http://catalog.api/hc
- OrderingUrlHC=http://ordering.api/hc
- IdentityUrlHC=http://identity.api/hc
- BasketUrlHC=http://basket.api/hc
- MarketingUrlHC=http://marketing.api/hc
- PaymentUrlHC=http://payment.api/hc
- LocationUrlHC=http://locations.api/hc
ports:
- "5120:80" # Important: In a production environment your should remove the external port (5120) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
@ -300,9 +297,17 @@ services:
- urls__catalog=http://catalog.api
- urls__orders=http://ordering.api
- urls__identity=http://identity.api #Local: You need to open your local dev-machine firewall at range 5100-5110.
- CatalogUrlHC=http://catalog.api/hc
- OrderingUrlHC=http://ordering.api/hc
- IdentityUrlHC=http://identity.api/hc
- BasketUrlHC=http://basket.api/hc
- MarketingUrlHC=http://marketing.api/hc
- PaymentUrlHC=http://payment.api/hc
- LocationUrlHC=http://locations.api/hc
ports:
- "5121:80" # Important: In a production environment your should remove the external port (5121) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
ordering.signalrhub:
environment:
- ASPNETCORE_ENVIRONMENT=Development
@ -317,3 +322,92 @@ services:
ports:
- "5112:80"
webstatus:
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=http://0.0.0.0:80
- HealthChecks-UI__HealthChecks__1__Name=WebMVC HTTP Check
- HealthChecks-UI__HealthChecks__1__Uri=http://webmvc/hc
- HealthChecks-UI__HealthChecks__2__Name=WebSPA HTTP Check
- HealthChecks-UI__HealthChecks__2__Uri=http://webspa/hc
- HealthChecks-UI__HealthChecks__3__Name=Web Shopping Aggregator GW HTTP Check
- HealthChecks-UI__HealthChecks__3__Uri=http://webshoppingagg/hc
- HealthChecks-UI__HealthChecks__4__Name=Mobile Shopping Aggregator HTTP Check
- HealthChecks-UI__HealthChecks__4__Uri=http://mobileshoppingagg/hc
- HealthChecks-UI__HealthChecks__5__Name=Mobile Shopping API GW HTTP Check
- HealthChecks-UI__HealthChecks__5__Uri=http://mobileshoppingapigw/hc
- HealthChecks-UI__HealthChecks__6__Name=Mobile Marketing API GW HTTP Check
- HealthChecks-UI__HealthChecks__6__Uri=http://mobilemarketingapigw/hc
- HealthChecks-UI__HealthChecks__7__Name=Web Shopping API GW HTTP Check
- HealthChecks-UI__HealthChecks__7__Uri=http://webshoppingapigw/hc
- HealthChecks-UI__HealthChecks__8__Name=Web Marketing API GW HTTP Check
- HealthChecks-UI__HealthChecks__8__Uri=http://webmarketingapigw/hc
- HealthChecks-UI__HealthChecks__9__Name=Ordering HTTP Check
- HealthChecks-UI__HealthChecks__9__Uri=http://ordering.api/hc
- HealthChecks-UI__HealthChecks__10__Name=Ordering HTTP Background Check
- HealthChecks-UI__HealthChecks__10__Uri=http://ordering.backgroundtasks/hc
- HealthChecks-UI__HealthChecks__11__Name=Basket HTTP Check
- HealthChecks-UI__HealthChecks__11__Uri=http://basket.api/hc
- HealthChecks-UI__HealthChecks__12__Name=Catalog HTTP Check
- HealthChecks-UI__HealthChecks__12__Uri=http://catalog.api/hc
- HealthChecks-UI__HealthChecks__13__Name=Identity HTTP Check
- HealthChecks-UI__HealthChecks__13__Uri=http://identity.api/hc
- HealthChecks-UI__HealthChecks__14__Name=Marketing HTTP Check
- HealthChecks-UI__HealthChecks__14__Uri=http://marketing.api/hc
- HealthChecks-UI__HealthChecks__15__Name=Locations HTTP Check
- HealthChecks-UI__HealthChecks__15__Uri=http://locations.api/hc
- HealthChecks-UI__HealthChecks__16__Name=Payments HTTP Check
- HealthChecks-UI__HealthChecks__16__Uri=http://payment.api/hc
- HealthChecks-UI__HealthChecks__17__Name=Ordering SignalRHub HTTP Check
- HealthChecks-UI__HealthChecks__17__Uri=http://ordering.signalrhub/hc
- OrderingBackgroundTasksUrl=http://ordering.backgroundtasks/hc
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
ports:
- "5107:80"
webspa:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
- PurchaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
- MarketingUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5203
- PurchaseUrlHC=http://webshoppingapigw/hc
- MarketingUrlHC=http://webmarketingapigw/hc
- IdentityUrlHC=http://identity.api/hc
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
ports:
- "5104:80"
webmvc:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://0.0.0.0:80
- PurchaseUrl=http://webshoppingapigw
- IdentityUrl=http://10.0.75.1:5105 # Local Mac: Use http://docker.for.mac.localhost:5105 || Local Windows: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser. || #Remote access: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser.
- MarketingUrl=http://webmarketingapigw
- SignalrHubUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5202
- IdentityUrlHC=http://identity.api/hc
- PurchaseUrlHC=http://webshoppingapigw/hc
- MarketingUrlHC=http://webmarketingapigw/hc
- UseCustomizationData=True
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
ports:
- "5100:80"
webhooks.client:
environment:
- ASPNETCORE_URLS=http://0.0.0.0:80
- Token=6168DB8D-DC58-4094-AF24-483278923590 # Webhooks are registered with this token (any value is valid) but the client won't check it
- IdentityUrl=http://10.0.75.1:5105
- CallBackUrl=http://localhost:5114
- WebhooksUrl=http://webhooks.api
- SelfUrl=http://webhooks.client/
ports:
- "5114:80"

+ 0
- 1
docker-compose.prod.yml View File

@ -85,7 +85,6 @@ services:
- UseCustomizationData=True
- AzureServiceBusEnabled=False
- CheckUpdateTime=30000
- GracePeriodTime=1
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}


+ 39
- 0
docker-compose.windows.yml View File

@ -0,0 +1,39 @@
# This file contains specific services build and images for Windows Containers.
#
# MUST be used alongside "docker-compose.yml" in all windows container commands
version: '3.4'
services:
sql.data:
image: microsoft/mssql-server-windows-developer
nosql.data:
image: mongo:windowsservercore
basket.data:
image: redis:nanoserver
rabbitmq:
image: spring2/rabbitmq
identity.api:
build:
args:
NODE_IMAGE: stefanscherer/node-windows:8.11
webspa:
build:
args:
NODE_IMAGE: stefanscherer/node-windows:8.11
webmvc:
build:
args:
NODE_IMAGE: stefanscherer/node-windows:8.11
networks:
default:
external:
name: nat

+ 142
- 66
docker-compose.yml View File

@ -1,9 +1,31 @@
version: '3.4'
services:
seq:
image: datalust/seq:latest
sql.data:
image: microsoft/mssql-server-linux:2017-latest
nosql.data:
image: mongo
basket.data:
image: redis:alpine
rabbitmq:
image: rabbitmq:3-management-alpine
identity.api:
image: ${REGISTRY:-eshop}/identity.api:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Identity/Identity.API/Dockerfile
depends_on:
- sql.data
basket.api:
image: eshop/basket.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/basket.api:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Basket/Basket.API/Dockerfile
@ -13,7 +35,7 @@ services:
- rabbitmq
catalog.api:
image: eshop/catalog.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/catalog.api:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Catalog/Catalog.API/Dockerfile
@ -21,16 +43,8 @@ services:
- sql.data
- rabbitmq
identity.api:
image: eshop/identity.api:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Identity/Identity.API/Dockerfile
depends_on:
- sql.data
ordering.api:
image: eshop/ordering.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/ordering.api:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.API/Dockerfile
@ -39,7 +53,7 @@ services:
- rabbitmq
ordering.backgroundtasks:
image: eshop/ordering.backgroundtasks:${TAG:-latest}
image: ${REGISTRY:-eshop}/ordering.backgroundtasks:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile
@ -48,7 +62,7 @@ services:
- rabbitmq
marketing.api:
image: eshop/marketing.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/marketing.api:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Marketing/Marketing.API/Dockerfile
@ -58,46 +72,16 @@ services:
- identity.api
- rabbitmq
webspa:
image: eshop/webspa:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebSPA/Dockerfile
depends_on:
- catalog.api
- ordering.api
- identity.api
- basket.api
- marketing.api
webmvc:
image: eshop/webmvc:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebMVC/Dockerfile
depends_on:
- catalog.api
- ordering.api
- identity.api
- basket.api
- marketing.api
webstatus:
image: eshop/webstatus:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebStatus/Dockerfile
payment.api:
image: eshop/payment.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/payment.api:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Payment/Payment.API/Dockerfile
depends_on:
- rabbitmq
locations.api:
image: eshop/locations.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/locations.api:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Location/Locations.API/Dockerfile
@ -105,57 +89,149 @@ services:
- nosql.data
- rabbitmq
sql.data:
image: microsoft/mssql-server-linux:2017-latest
nosql.data:
image: mongo
basket.data:
image: redis:alpine
rabbitmq:
image: rabbitmq:3-management-alpine
webhooks.api:
image: ${REGISTRY:-eshop}/webhooks.api:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Webhooks/Webhooks.API/Dockerfile
depends_on:
- sql.data
mobileshoppingapigw:
image: eshop/ocelotapigw:${TAG:-latest}
image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile
depends_on:
- nosql.data
- sql.data
- identity.api
- rabbitmq
- ordering.api
- marketing.api
- catalog.api
- basket.api
mobilemarketingapigw:
image: eshop/ocelotapigw:${TAG:-latest}
image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile
depends_on:
- nosql.data
- sql.data
- identity.api
- rabbitmq
- ordering.api
- marketing.api
- catalog.api
- basket.api
webshoppingapigw:
image: eshop/ocelotapigw:${TAG:-latest}
image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile
depends_on:
- nosql.data
- sql.data
- identity.api
- rabbitmq
- ordering.api
- marketing.api
- catalog.api
- basket.api
webmarketingapigw:
image: eshop/ocelotapigw:${TAG:-latest}
image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile
depends_on:
- nosql.data
- sql.data
- identity.api
- rabbitmq
- ordering.api
- marketing.api
- catalog.api
- basket.api
mobileshoppingagg:
image: eshop/mobileshoppingagg:${TAG:-latest}
image: ${REGISTRY:-eshop}/mobileshoppingagg:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
depends_on:
- nosql.data
- sql.data
- identity.api
- rabbitmq
- ordering.api
- marketing.api
- catalog.api
- basket.api
webshoppingagg:
image: eshop/webshoppingagg:${TAG:-latest}
image: ${REGISTRY:-eshop}/webshoppingagg:${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
depends_on:
- nosql.data
- sql.data
- identity.api
- rabbitmq
- ordering.api
- marketing.api
- catalog.api
- basket.api
ordering.signalrhub:
image: eshop/ordering.signalrhub:${TAG:-latest}
image: ${REGISTRY:-eshop}/ordering.signalrhub:${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.SignalrHub/Dockerfile
depends_on:
- nosql.data
- sql.data
- identity.api
- rabbitmq
- ordering.api
- marketing.api
- catalog.api
- basket.api
webstatus:
image: ${REGISTRY:-eshop}/webstatus:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebStatus/Dockerfile
webspa:
image: ${REGISTRY:-eshop}/webspa:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebSPA/Dockerfile
# depends_on:
# - webshoppingagg
# - webshoppingapigw
# - webmarketingapigw
webmvc:
image: ${REGISTRY:-eshop}/webmvc:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebMVC/Dockerfile
depends_on:
- webshoppingagg
- webshoppingapigw
- webmarketingapigw
webhooks.client:
image: ${REGISTRY:-eshop}/webhooks.client:${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebhookClient/Dockerfile
depends_on:
- webhooks.api

+ 8
- 0
docker-scripts/linux/install-node.sh View File

@ -0,0 +1,8 @@
#!/bin/sh
export NODE_DOWNLOAD_SHA 0e20787e2eda4cc31336d8327556ebc7417e8ee0a6ba0de96a09b0ec2b841f60
curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz \
&& echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \
&& tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \
&& rm nodejs.tar.gz \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs

+ 4
- 0
docker-scripts/win/install-node.cmd View File

@ -0,0 +1,4 @@
set NODE_VERSION=8.11.1
curl -SL "https://nodejs.org/dist/v%NODE_VERSION%/node-v%NODE_VERSION%-win-x64.zip" --output nodejs.zip
tar -xf nodejs.zip -C c:\
setx PATH "%PATH%;c:\node-v%NODE_VERSION%-win-x64"

BIN
docs/Decks/BRK3175_CesarDeIaTorre.pptx View File


BIN
docs/Decks/eShopOnContainers-Architecture-v2.1.pptx View File


+ 686
- 521
eShopOnContainers-ServicesAndWebApps.sln
File diff suppressed because it is too large
View File


+ 709
- 466
eShopOnContainers.sln
File diff suppressed because it is too large
View File


+ 0
- 5
global.json View File

@ -1,5 +0,0 @@
{
"sdk": {
"version": "2.1.4"
}
}

+ 0
- 23
hosts View File

@ -1,23 +0,0 @@
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
10.0.75.1 identity.service

+ 1
- 3
k8s/deploy-ingress-azure.ps1 View File

@ -1,3 +1 @@
kubectl patch deployment -n ingress-nginx nginx-ingress-controller --type=json --patch="$(cat nginx-ingress\publish-service-patch.yaml)"
kubectl apply -f nginx-ingress\azure\service.yaml
kubectl apply -f nginx-ingress\patch-service-without-rbac.yaml
kubectl apply -f nginx-ingress\cloud-generic.yaml

+ 2
- 0
k8s/deploy-ingress-dockerlocal.ps1 View File

@ -0,0 +1,2 @@
kubectl apply -f nginx-ingress\cm.yaml
kubectl apply -f nginx-ingress\cloud-generic.yaml

+ 1
- 8
k8s/deploy-ingress.ps1 View File

@ -1,12 +1,5 @@
kubectl apply -f ingress.yaml
# Deploy nginx-ingress core files
kubectl apply -f nginx-ingress\namespace.yaml
kubectl apply -f nginx-ingress\default-backend.yaml
kubectl apply -f nginx-ingress\configmap.yaml
kubectl apply -f nginx-ingress\tcp-services-configmap.yaml
kubectl apply -f nginx-ingress\udp-services-configmap.yaml
kubectl apply -f nginx-ingress\without-rbac.yaml
kubectl apply -f nginx-ingress\mandatory.yaml

+ 4
- 0
k8s/deploy.ps1 View File

@ -113,6 +113,7 @@ ExecKube -cmd 'delete configmap internalurls'
ExecKube -cmd 'delete configmap urls'
ExecKube -cmd 'delete configmap externalcfg'
ExecKube -cmd 'delete configmap ocelot'
ExecKube -cmd 'delete -f ingress.yaml'
# start sql, rabbitmq, frontend deployments
if ($deployInfrastructure) {
@ -204,5 +205,8 @@ ExecKube -cmd 'rollout resume deployments/apigwwm'
ExecKube -cmd 'rollout resume deployments/apigwws'
ExecKube -cmd 'rollout resume deployments/ordering-signalrhub'
Write-Host "Adding/Updating ingress resource..." -ForegroundColor Yellow
ExecKube -cmd 'apply -f ingress.yaml'
Write-Host "WebSPA is exposed at http://$externalDns, WebMVC at http://$externalDns/webmvc, WebStatus at http://$externalDns/webstatus" -ForegroundColor Yellow

+ 18
- 0
k8s/helm-rbac.yaml View File

@ -0,0 +1,18 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system

+ 12
- 0
k8s/helm/aks-httpaddon-cfg.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
labels:
# addonmanager.kubernetes.io/mode: Reconcile
app: addon-http-application-routing-ingress-nginx
kubernetes.io/cluster-service: "true"
name: addon-http-application-routing-nginx-configuration
namespace: kube-system
data:
proxy-buffer-size: "128k"
proxy-buffers: "4 256k"

+ 21
- 0
k8s/helm/apigwmm/.helmignore View File

@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

+ 5
- 0
k8s/helm/apigwmm/Chart.yaml View File

@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: apigwmm
version: 0.1.0

+ 34
- 0
k8s/helm/apigwmm/configuration-mobile-marketing.json View File

@ -0,0 +1,34 @@
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "marketing",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/m/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "locations",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/l/{everything}",
"UpstreamHttpMethod": []
}
],
"GlobalConfiguration": {
"RequestIdKey": "OcRequestId",
"AdministrationPath": "/administration"
}
}

+ 2
- 0
k8s/helm/apigwmm/templates/NOTES.txt View File

@ -0,0 +1,2 @@
eShop API Gateway for Mobile Marketing services installed
----------------------------------------------------------

+ 32
- 0
k8s/helm/apigwmm/templates/_helpers.tpl View File

@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "apigwmm.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "apigwmm.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "apigwmm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

+ 53
- 0
k8s/helm/apigwmm/templates/_names.tpl View File

@ -0,0 +1,53 @@
{{- define "suffix-name" -}}
{{- if .Values.app.name -}}
{{- .Values.app.name -}}
{{- else -}}
{{- .Release.Name -}}
{{- end -}}
{{- end -}}
{{- define "sql-name" -}}
{{- if .Values.inf.sql.host -}}
{{- .Values.inf.sql.host -}}
{{- else -}}
{{- printf "%s" "sql-data" -}}
{{- end -}}
{{- end -}}
{{- define "mongo-name" -}}
{{- if .Values.inf.mongo.host -}}
{{- .Values.inf.mongo.host -}}
{{- else -}}
{{- printf "%s" "nosql-data" -}}
{{- end -}}
{{- end -}}
{{- define "url-of" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if eq $name "" -}}
{{- $ctx.Values.inf.k8s.dns -}}
{{- else -}}
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}}
{{- end -}}
{{- end -}}
{{- define "pathBase" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if $ctx.Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" $ctx -}}
{{- printf "/%s-%s" $name $suffix -}}
{{- else -}}
{{- printf "/%s" $name -}}
{{- end -}}
{{- end -}}
{{- define "fqdn-image" -}}
{{- if .Values.inf.registry -}}
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}}
{{- else -}}
{{- .Values.image.repository -}}
{{- end -}}
{{- end -}}

+ 21
- 0
k8s/helm/apigwmm/templates/configmap.yaml View File

@ -0,0 +1,21 @@
{{- $name := include "apigwmm.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "cfg-{{ $name }}"
labels:
app: {{ template "apigwmm.name" . }}
chart: {{ template "apigwmm.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
internalurls__identity: http://{{ .Values.app.svc.identity }}
internalurls__basket__hc: http://{{ .Values.app.svc.basket }}/hc
internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc
internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc
internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc
internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc
internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc
internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc

+ 103
- 0
k8s/helm/apigwmm/templates/deployment.yaml View File

@ -0,0 +1,103 @@
{{- $name := include "apigwmm.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
{{- $ocelotcfgname := printf "%s-%s" "ocelot" $name -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "apigwmm.fullname" . }}
labels:
ufo: {{ $cfgname}}
app: {{ template "apigwmm.name" . }}
chart: {{ template "apigwmm.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "apigwmm.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "apigwmm.name" . }}
release: {{ .Release.Name }}
spec:
{{ if .Values.inf.registry -}}
imagePullSecrets:
- name: {{ .Values.inf.registry.secretName }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ $ocelotcfgname }}
items:
- key: configuration-mobile-marketing.json
path: configuration.json
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: /app/configuration
env:
- name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) }}
- name: k8sname
value: {{ .Values.clusterName }}
{{- if .Values.env.values -}}
{{- range .Values.env.values }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end -}}
{{- end -}}
{{- if .Values.env.configmap -}}
{{- range .Values.env.configmap }}
- name: {{ .name }}
valueFrom:
configMapKeyRef:
name: {{ $cfgname }}
key: {{ .key }}
{{- end -}}
{{- end }}
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

+ 33
- 0
k8s/helm/apigwmm/templates/ingress.yaml View File

@ -0,0 +1,33 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "apigwmm.fullname" . }}
labels:
app: {{ template "apigwmm.name" . }}
chart: {{ template "apigwmm.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.mobilemarketingapigw }}
servicePort: http
{{- end }}

+ 14
- 0
k8s/helm/apigwmm/templates/ocelot-cm.yaml View File

@ -0,0 +1,14 @@
{{- $name := include "apigwmm.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "ocelot-{{ $name }}"
labels:
app: {{ template "apigwmm.name" . }}
chart: {{ template "apigwmm.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ (.Files.Glob "configuration-mobile-marketing.json").AsConfig | indent 2 }}

+ 19
- 0
k8s/helm/apigwmm/templates/service.yaml View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app.svc.mobilemarketingapigw }}
labels:
app: {{ template "apigwmm.name" . }}
chart: {{ template "apigwmm.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "apigwmm.name" . }}
release: {{ .Release.Name }}

+ 64
- 0
k8s/helm/apigwmm/values.yaml View File

@ -0,0 +1,64 @@
replicaCount: 1
clusterName: eshop-aks
pathBase: /mobilemarketingapigw
image:
repository: eshop/ocelotapigw
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: true
annotations: {}
tls: []
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
# env defines the environment variables that will be declared in the pod
env:
urls:
# configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap).
configmap:
- name: IdentityUrl
key: internalurls__identity
- name: CatalogUrlHC
key: internalurls__catalog__hc
- name: BasketUrlHC
key: internalurls__basket__hc
- name: IdentityUrlHC
key: internalurls__identity__hc
- name: OrderingUrlHC
key: internalurls__ordering__hc
- name: MarketingUrlHC
key: internalurls__marketing__hc
- name: PaymentUrlHC
key: internalurls__payment__hc
- name: LocationUrlHC
key: internalurls__location__hc
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:
- name: ASPNETCORE_ENVIRONMENT
value: Development
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/apigwms/.helmignore View File

@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

+ 5
- 0
k8s/helm/apigwms/Chart.yaml View File

@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: apigwms
version: 0.1.0

+ 142
- 0
k8s/helm/apigwms/configuration-mobile-shopping.json View File

@ -0,0 +1,142 @@
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "catalog",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/c/{everything}",
"UpstreamHttpMethod": [ "GET" ]
},
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basket",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/b/{everything}",
"UpstreamHttpMethod": [],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "ordering",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/o/{everything}",
"UpstreamHttpMethod": [],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "mobileshoppingagg",
"Port": 80
}
],
"UpstreamPathTemplate": "/{everything}",
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "ordering",
"Port": 80
}
],
"UpstreamPathTemplate": "/orders-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basket",
"Port": 80
}
],
"UpstreamPathTemplate": "/basket-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "catalog",
"Port": 80
}
],
"UpstreamPathTemplate": "/catalog-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "marketing",
"Port": 80
}
],
"UpstreamPathTemplate": "/marketing-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "payment",
"Port": 80
}
],
"UpstreamPathTemplate": "/payment-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "locations.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/location-api/{everything}",
"UpstreamHttpMethod": []
}
],
"GlobalConfiguration": {
"RequestIdKey": "OcRequestId",
"AdministrationPath": "/administration"
}
}

+ 2
- 0
k8s/helm/apigwms/templates/NOTES.txt View File

@ -0,0 +1,2 @@
eShop API Gateway for Mobile Shopping services installed
--------------------------------------------------------

+ 32
- 0
k8s/helm/apigwms/templates/_helpers.tpl View File

@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "apigwms.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "apigwms.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "apigwms.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

+ 54
- 0
k8s/helm/apigwms/templates/_names.tpl View File

@ -0,0 +1,54 @@
{{- define "suffix-name" -}}
{{- if .Values.app.name -}}
{{- .Values.app.name -}}
{{- else -}}
{{- .Release.Name -}}
{{- end -}}
{{- end -}}
{{- define "sql-name" -}}
{{- if .Values.inf.sql.host -}}
{{- .Values.inf.sql.host -}}
{{- else -}}
{{- printf "%s" "sql-data" -}}
{{- end -}}
{{- end -}}
{{- define "mongo-name" -}}
{{- if .Values.inf.mongo.host -}}
{{- .Values.inf.mongo.host -}}
{{- else -}}
{{- printf "%s" "nosql-data" -}}
{{- end -}}
{{- end -}}
{{- define "url-of" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if eq $name "" -}}
{{- $ctx.Values.inf.k8s.dns -}}
{{- else -}}
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}}
{{- end -}}
{{- end -}}
{{- define "pathBase" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if $ctx.Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" $ctx -}}
{{- printf "/%s-%s" $name $suffix -}}
{{- else -}}
{{- printf "/%s" $name -}}
{{- end -}}
{{- end -}}
{{- define "fqdn-image" -}}
{{- if .Values.inf.registry -}}
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}}
{{- else -}}
{{- .Values.image.repository -}}
{{- end -}}
{{- end -}}

+ 21
- 0
k8s/helm/apigwms/templates/configmap.yaml View File

@ -0,0 +1,21 @@
{{- $name := include "apigwms.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "cfg-{{ $name }}"
labels:
app: {{ template "apigwms.name" . }}
chart: {{ template "apigwms.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
internalurls__identity: http://{{ .Values.app.svc.identity }}
internalurls__basket__hc: http://{{ .Values.app.svc.basket }}/hc
internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc
internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc
internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc
internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc
internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc
internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc

+ 103
- 0
k8s/helm/apigwms/templates/deployment.yaml View File

@ -0,0 +1,103 @@
{{- $name := include "apigwms.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
{{- $ocelotcfgname := printf "%s-%s" "ocelot" $name -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "apigwms.fullname" . }}
labels:
ufo: {{ $cfgname}}
app: {{ template "apigwms.name" . }}
chart: {{ template "apigwms.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "apigwms.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "apigwms.name" . }}
release: {{ .Release.Name }}
spec:
{{ if .Values.inf.registry -}}
imagePullSecrets:
- name: {{ .Values.inf.registry.secretName }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ $ocelotcfgname }}
items:
- key: configuration-mobile-shopping.json
path: configuration.json
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: /app/configuration
env:
- name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) }}
- name: k8sname
value: {{ .Values.clusterName }}
{{- if .Values.env.values -}}
{{- range .Values.env.values }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end -}}
{{- end -}}
{{- if .Values.env.configmap -}}
{{- range .Values.env.configmap }}
- name: {{ .name }}
valueFrom:
configMapKeyRef:
name: {{ $cfgname }}
key: {{ .key }}
{{- end -}}
{{- end }}
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

+ 33
- 0
k8s/helm/apigwms/templates/ingress.yaml View File

@ -0,0 +1,33 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "apigwms.fullname" . }}
labels:
app: {{ template "apigwms.name" . }}
chart: {{ template "apigwms.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.mobileshoppingapigw }}
servicePort: http
{{- end }}

+ 14
- 0
k8s/helm/apigwms/templates/ocelot-cm.yaml View File

@ -0,0 +1,14 @@
{{- $name := include "apigwms.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "ocelot-{{ $name }}"
labels:
app: {{ template "apigwms.name" . }}
chart: {{ template "apigwms.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ (.Files.Glob "configuration-mobile-shopping.json").AsConfig | indent 2 }}

+ 19
- 0
k8s/helm/apigwms/templates/service.yaml View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app.svc.mobileshoppingapigw }}
labels:
app: {{ template "apigwms.name" . }}
chart: {{ template "apigwms.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "apigwms.name" . }}
release: {{ .Release.Name }}

+ 64
- 0
k8s/helm/apigwms/values.yaml View File

@ -0,0 +1,64 @@
replicaCount: 1
clusterName: eshop-aks
pathBase: /mobileshoppingapigw
image:
repository: eshop/ocelotapigw
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: true
annotations: {}
tls: []
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
# env defines the environment variables that will be declared in the pod
env:
urls:
# configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap).
configmap:
- name: IdentityUrl
key: internalurls__identity
- name: CatalogUrlHC
key: internalurls__catalog__hc
- name: BasketUrlHC
key: internalurls__basket__hc
- name: IdentityUrlHC
key: internalurls__identity__hc
- name: OrderingUrlHC
key: internalurls__ordering__hc
- name: MarketingUrlHC
key: internalurls__marketing__hc
- name: PaymentUrlHC
key: internalurls__payment__hc
- name: LocationUrlHC
key: internalurls__location__hc
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:
- name: ASPNETCORE_ENVIRONMENT
value: Development
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/apigwwm/.helmignore View File

@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

+ 5
- 0
k8s/helm/apigwwm/Chart.yaml View File

@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: apigwwm
version: 0.1.0

+ 34
- 0
k8s/helm/apigwwm/configuration-web-marketing.json View File

@ -0,0 +1,34 @@
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "marketing",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/m/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "locations",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/l/{everything}",
"UpstreamHttpMethod": []
}
],
"GlobalConfiguration": {
"RequestIdKey": "OcRequestId",
"AdministrationPath": "/administration"
}
}

+ 2
- 0
k8s/helm/apigwwm/templates/NOTES.txt View File

@ -0,0 +1,2 @@
eShop API Gateway for Web Marketing services installed
------------------------------------------------------

+ 32
- 0
k8s/helm/apigwwm/templates/_helpers.tpl View File

@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "apigwwm.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "apigwwm.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "apigwwm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

+ 54
- 0
k8s/helm/apigwwm/templates/_names.tpl View File

@ -0,0 +1,54 @@
{{- define "suffix-name" -}}
{{- if .Values.app.name -}}
{{- .Values.app.name -}}
{{- else -}}
{{- .Release.Name -}}
{{- end -}}
{{- end -}}
{{- define "sql-name" -}}
{{- if .Values.inf.sql.host -}}
{{- .Values.inf.sql.host -}}
{{- else -}}
{{- printf "%s" "sql-data" -}}
{{- end -}}
{{- end -}}
{{- define "mongo-name" -}}
{{- if .Values.inf.mongo.host -}}
{{- .Values.inf.mongo.host -}}
{{- else -}}
{{- printf "%s" "nosql-data" -}}
{{- end -}}
{{- end -}}
{{- define "url-of" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if eq $name "" -}}
{{- $ctx.Values.inf.k8s.dns -}}
{{- else -}}
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}}
{{- end -}}
{{- end -}}
{{- define "pathBase" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if $ctx.Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" $ctx -}}
{{- printf "/%s-%s" $name $suffix -}}
{{- else -}}
{{- printf "/%s" $name -}}
{{- end -}}
{{- end -}}
{{- define "fqdn-image" -}}
{{- if .Values.inf.registry -}}
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}}
{{- else -}}
{{- .Values.image.repository -}}
{{- end -}}
{{- end -}}

+ 21
- 0
k8s/helm/apigwwm/templates/configmap.yaml View File

@ -0,0 +1,21 @@
{{- $name := include "apigwwm.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "cfg-{{ $name }}"
labels:
app: {{ template "apigwwm.name" . }}
chart: {{ template "apigwwm.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
internalurls__identity: http://{{ .Values.app.svc.identity }}
internalurls__basket__hc: http://{{ .Values.app.svc.basket }}/hc
internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc
internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc
internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc
internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc
internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc
internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc

+ 103
- 0
k8s/helm/apigwwm/templates/deployment.yaml View File

@ -0,0 +1,103 @@
{{- $name := include "apigwwm.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
{{- $ocelotcfgname := printf "%s-%s" "ocelot" $name -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "apigwwm.fullname" . }}
labels:
ufo: {{ $cfgname}}
app: {{ template "apigwwm.name" . }}
chart: {{ template "apigwwm.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "apigwwm.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "apigwwm.name" . }}
release: {{ .Release.Name }}
spec:
{{ if .Values.inf.registry -}}
imagePullSecrets:
- name: {{ .Values.inf.registry.secretName }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ $ocelotcfgname }}
items:
- key: configuration-web-marketing.json
path: configuration.json
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: /app/configuration
env:
- name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) }}
- name: k8sname
value: {{ .Values.clusterName }}
{{- if .Values.env.values -}}
{{- range .Values.env.values }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end -}}
{{- end -}}
{{- if .Values.env.configmap -}}
{{- range .Values.env.configmap }}
- name: {{ .name }}
valueFrom:
configMapKeyRef:
name: {{ $cfgname }}
key: {{ .key }}
{{- end -}}
{{- end }}
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

+ 33
- 0
k8s/helm/apigwwm/templates/ingress.yaml View File

@ -0,0 +1,33 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "apigwwm.fullname" . }}
labels:
app: {{ template "apigwwm.name" . }}
chart: {{ template "apigwwm.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.webmarketingapigw }}
servicePort: http
{{- end }}

+ 14
- 0
k8s/helm/apigwwm/templates/ocelot-cm.yaml View File

@ -0,0 +1,14 @@
{{- $name := include "apigwwm.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "ocelot-{{ $name }}"
labels:
app: {{ template "apigwwm.name" . }}
chart: {{ template "apigwwm.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ (.Files.Glob "configuration-web-marketing.json").AsConfig | indent 2 -}}

+ 19
- 0
k8s/helm/apigwwm/templates/service.yaml View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app.svc.webmarketingapigw }}
labels:
app: {{ template "apigwwm.name" . }}
chart: {{ template "apigwwm.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "apigwwm.name" . }}
release: {{ .Release.Name }}

+ 64
- 0
k8s/helm/apigwwm/values.yaml View File

@ -0,0 +1,64 @@
replicaCount: 1
clusterName: eshop-aks
pathBase: /webmarketingapigw
image:
repository: eshop/ocelotapigw
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: true
annotations: {}
tls: []
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
# env defines the environment variables that will be declared in the pod
env:
urls:
# configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap).
configmap:
- name: IdentityUrl
key: internalurls__identity
- name: CatalogUrlHC
key: internalurls__catalog__hc
- name: BasketUrlHC
key: internalurls__basket__hc
- name: IdentityUrlHC
key: internalurls__identity__hc
- name: OrderingUrlHC
key: internalurls__ordering__hc
- name: MarketingUrlHC
key: internalurls__marketing__hc
- name: PaymentUrlHC
key: internalurls__payment__hc
- name: LocationUrlHC
key: internalurls__location__hc
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:
- name: ASPNETCORE_ENVIRONMENT
value: Development
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 21
- 0
k8s/helm/apigwws/.helmignore View File

@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

+ 5
- 0
k8s/helm/apigwws/Chart.yaml View File

@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: apigwws
version: 0.1.0

+ 154
- 0
k8s/helm/apigwws/configuration-web-shopping.json View File

@ -0,0 +1,154 @@
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "catalog",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/c/{everything}",
"UpstreamHttpMethod": [ "GET" ]
},
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basket",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/b/{everything}",
"UpstreamHttpMethod": [],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/api/{version}/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "ordering",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/{version}/o/{everything}",
"UpstreamHttpMethod": [],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "webshoppingagg",
"Port": 80
}
],
"UpstreamPathTemplate": "/{everything}",
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ],
"AuthenticationOptions": {
"AuthenticationProviderKey": "IdentityApiKey",
"AllowedScopes": []
}
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "ordering",
"Port": 80
}
],
"UpstreamPathTemplate": "/orders-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "ordering-signalrhub",
"Port": 80
}
],
"UpstreamPathTemplate": "/hub/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basket",
"Port": 80
}
],
"UpstreamPathTemplate": "/basket-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "catalog",
"Port": 80
}
],
"UpstreamPathTemplate": "/catalog-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "marketing",
"Port": 80
}
],
"UpstreamPathTemplate": "/marketing-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "payment",
"Port": 80
}
],
"UpstreamPathTemplate": "/payment-api/{everything}",
"UpstreamHttpMethod": []
},
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "locations.api",
"Port": 80
}
],
"UpstreamPathTemplate": "/location-api/{everything}",
"UpstreamHttpMethod": []
}
],
"GlobalConfiguration": {
"RequestIdKey": "OcRequestId",
"AdministrationPath": "/administration"
}
}

+ 2
- 0
k8s/helm/apigwws/templates/NOTES.txt View File

@ -0,0 +1,2 @@
eShop API Gateway for Web Shopping services installed
-----------------------------------------------------

+ 32
- 0
k8s/helm/apigwws/templates/_helpers.tpl View File

@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "apigwws.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "apigwws.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "apigwws.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

+ 53
- 0
k8s/helm/apigwws/templates/_names.tpl View File

@ -0,0 +1,53 @@
{{- define "suffix-name" -}}
{{- if .Values.app.name -}}
{{- .Values.app.name -}}
{{- else -}}
{{- .Release.Name -}}
{{- end -}}
{{- end -}}
{{- define "sql-name" -}}
{{- if .Values.inf.sql.host -}}
{{- .Values.inf.sql.host -}}
{{- else -}}
{{- printf "%s" "sql-data" -}}
{{- end -}}
{{- end -}}
{{- define "mongo-name" -}}
{{- if .Values.inf.mongo.host -}}
{{- .Values.inf.mongo.host -}}
{{- else -}}
{{- printf "%s" "nosql-data" -}}
{{- end -}}
{{- end -}}
{{- define "url-of" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if eq $name "" -}}
{{- $ctx.Values.inf.k8s.dns -}}
{{- else -}}
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}}
{{- end -}}
{{- end -}}
{{- define "pathBase" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if $ctx.Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" $ctx -}}
{{- printf "/%s-%s" $name $suffix -}}
{{- else -}}
{{- printf "/%s" $name -}}
{{- end -}}
{{- end -}}
{{- define "fqdn-image" -}}
{{- if .Values.inf.registry -}}
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}}
{{- else -}}
{{- .Values.image.repository -}}
{{- end -}}
{{- end -}}

+ 21
- 0
k8s/helm/apigwws/templates/configmap.yaml View File

@ -0,0 +1,21 @@
{{- $name := include "apigwws.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "cfg-{{ $name }}"
labels:
app: {{ template "apigwws.name" . }}
chart: {{ template "apigwws.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
internalurls__identity: http://{{ .Values.app.svc.identity }}
internalurls__basket__hc: http://{{ .Values.app.svc.basket }}/hc
internalurls__catalog__hc: http://{{ .Values.app.svc.catalog }}/hc
internalurls__identity__hc: http://{{ .Values.app.svc.identity }}/hc
internalurls__ordering__hc: http://{{ .Values.app.svc.ordering }}/hc
internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc
internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc
internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc

+ 102
- 0
k8s/helm/apigwws/templates/deployment.yaml View File

@ -0,0 +1,102 @@
{{- $name := include "apigwws.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
{{- $ocelotcfgname := printf "%s-%s" "ocelot" $name -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "apigwws.fullname" . }}
labels:
app: {{ template "apigwws.name" . }}
chart: {{ template "apigwws.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "apigwws.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "apigwws.name" . }}
release: {{ .Release.Name }}
spec:
{{ if .Values.inf.registry -}}
imagePullSecrets:
- name: {{ .Values.inf.registry.secretName }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ $ocelotcfgname }}
items:
- key: configuration-web-shopping.json
path: configuration.json
containers:
- name: {{ .Chart.Name }}
{{ if .Values.probes -}}
{{- if .Values.probes.liveness -}}
livenessProbe:
httpGet:
port: {{ .Values.probes.liveness.port }}
path: {{ .Values.probes.liveness.path }}
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
{{- end -}}
{{- end -}}
{{- if .Values.probes -}}
{{- if .Values.probes.readiness }}
readinessProbe:
httpGet:
port: {{ .Values.probes.readiness.port }}
path: {{ .Values.probes.readiness.path }}
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{- end -}}
{{- end }}
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: /app/configuration
env:
- name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.webshoppingapigw .) }}
- name: k8sname
value: {{ .Values.clusterName }}
{{- if .Values.env.values -}}
{{- range .Values.env.values }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end -}}
{{- end -}}
{{- if .Values.env.configmap -}}
{{- range .Values.env.configmap }}
- name: {{ .name }}
valueFrom:
configMapKeyRef:
name: {{ $cfgname }}
key: {{ .key }}
{{- end -}}
{{- end }}
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

+ 33
- 0
k8s/helm/apigwws/templates/ingress.yaml View File

@ -0,0 +1,33 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.webshoppingapigw .) -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "apigwws.fullname" . }}
labels:
app: {{ template "apigwws.name" . }}
chart: {{ template "apigwws.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.webshoppingapigw }}
servicePort: http
{{- end }}

+ 14
- 0
k8s/helm/apigwws/templates/ocelot-cm.yaml View File

@ -0,0 +1,14 @@
{{- $name := include "apigwws.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "ocelot-{{ $name }}"
labels:
app: {{ template "apigwws.name" . }}
chart: {{ template "apigwws.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ (.Files.Glob "configuration-web-shopping.json").AsConfig | indent 2 }}

+ 19
- 0
k8s/helm/apigwws/templates/service.yaml View File

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app.svc.webshoppingapigw }}
labels:
app: {{ template "apigwws.name" . }}
chart: {{ template "apigwws.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "apigwws.name" . }}
release: {{ .Release.Name }}

+ 64
- 0
k8s/helm/apigwws/values.yaml View File

@ -0,0 +1,64 @@
replicaCount: 1
clusterName: eshop-aks
pathBase: /webshoppingapigw
image:
repository: eshop/ocelotapigw
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: true
annotations: {}
tls: []
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
# env defines the environment variables that will be declared in the pod
env:
urls:
# configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap).
configmap:
- name: IdentityUrl
key: internalurls__identity
- name: CatalogUrlHC
key: internalurls__catalog__hc
- name: BasketUrlHC
key: internalurls__basket__hc
- name: IdentityUrlHC
key: internalurls__identity__hc
- name: OrderingUrlHC
key: internalurls__ordering__hc
- name: MarketingUrlHC
key: internalurls__marketing__hc
- name: PaymentUrlHC
key: internalurls__payment__hc
- name: LocationUrlHC
key: internalurls__location__hc
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:
- name: ASPNETCORE_ENVIRONMENT
value: Development
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 47
- 0
k8s/helm/app.yaml View File

@ -0,0 +1,47 @@
# This helm values file defines app-based settings
# Charts use those values, so this file **MUST** be included in all chart releases
app: # app global settings
name: "my-eshop" # Override for custom app name
ingress: # ingress related settings
entries:
basket: basket-api # ingress entry for basket api
catalog: catalog-api # ingress entry for catalog api
ordering: ordering-api # ingress entry for ordering api
identity: identity # ingress entry for identity api
mvc: webmvc # ingress entry for web mvc
spa: "" # ingress entry for web spa
status: webstatus # ingress entry for web status
webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw
webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw
mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw
mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw
webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator
mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator
payment: payment-api # ingress entry for payment api
locations: locations-api # ingress entry for locations api
marketing: marketing-api # ingress entry for marketing api
webhooks: webhooks-api # ingress entry for webhooks api
webhooksweb: webhooks-web # ingress entry for webhooks web demo client
svc:
basket: basket # service name for basket api
catalog: catalog # service name for catalog api
ordering: ordering # service name for ordering api
orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks
orderingsignalrhub: ordering-signalrhub # service name for orderingsignalrhub
identity: identity # service name for identity api
mvc: webmvc # service name for web mvc
spa: webspa # service name for web spa
status: webstatus # service name for web status
webshoppingapigw: webshoppingapigw # service name for web shopping Agw
webmarketingapigw: webmarketingapigw # service name for web mkg Agw
mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw
mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw
webshoppingagg: webshoppingagg # service name for web shopping aggregator
mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator
payment: payment # service name for payment api
locations: locations # service name for locations api
marketing: marketing # service name for marketing ap
webhooks: webhooks # service name for webhooks api
webhooksweb: webhooksweb # service name for webhooks web

+ 21
- 0
k8s/helm/basket-api/.helmignore View File

@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

+ 5
- 0
k8s/helm/basket-api/Chart.yaml View File

@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: basket-api
version: 0.1.0

+ 8
- 0
k8s/helm/basket-api/templates/NOTES.txt View File

@ -0,0 +1,8 @@
eShop Basket API installed.
--------------------------
This API is not directly exposed outside cluster. If need to access it use:
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "basket-api.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80

+ 32
- 0
k8s/helm/basket-api/templates/_helpers.tpl View File

@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "basket-api.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "basket-api.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "basket-api.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

+ 52
- 0
k8s/helm/basket-api/templates/_names.tpl View File

@ -0,0 +1,52 @@
{{- define "suffix-name" -}}
{{- if .Values.app.name -}}
{{- .Values.app.name -}}
{{- else -}}
{{- .Release.Name -}}
{{- end -}}
{{- end -}}
{{- define "sql-name" -}}
{{- if .Values.inf.sql.host -}}
{{- .Values.inf.sql.host -}}
{{- else -}}
{{- printf "%s" "sql-data" -}}
{{- end -}}
{{- end -}}
{{- define "mongo-name" -}}
{{- if .Values.inf.mongo.host -}}
{{- .Values.inf.mongo.host -}}
{{- else -}}
{{- printf "%s" "nosql-data" -}}
{{- end -}}
{{- end -}}
{{- define "url-of" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if eq $name "" -}}
{{- $ctx.Values.inf.k8s.dns -}}
{{- else -}}
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}}
{{- end -}}
{{- end -}}
{{- define "pathBase" -}}
{{- if .Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" . -}}
{{- printf "%s-%s" .Values.pathBase $suffix -}}
{{- else -}}
{{- .Values.pathBase -}}
{{- end -}}
{{- end -}}
{{- define "fqdn-image" -}}
{{- if .Values.inf.registry -}}
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}}
{{- else -}}
{{- .Values.image.repository -}}
{{- end -}}
{{- end -}}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save