@ -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. | |||
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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). |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -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 | |||
@ -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 |
@ -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 |
@ -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" |
@ -1,5 +0,0 @@ | |||
{ | |||
"sdk": { | |||
"version": "2.1.4" | |||
} | |||
} |
@ -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 +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 |
@ -0,0 +1,2 @@ | |||
kubectl apply -f nginx-ingress\cm.yaml | |||
kubectl apply -f nginx-ingress\cloud-generic.yaml |
@ -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 | |||
@ -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 |
@ -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" |
@ -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 |
@ -0,0 +1,5 @@ | |||
apiVersion: v1 | |||
appVersion: "1.0" | |||
description: A Helm chart for Kubernetes | |||
name: apigwmm | |||
version: 0.1.0 |
@ -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" | |||
} | |||
} | |||
@ -0,0 +1,2 @@ | |||
eShop API Gateway for Mobile Marketing services installed | |||
---------------------------------------------------------- |
@ -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 -}} |
@ -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 -}} |
@ -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 | |||
@ -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 }} | |||
@ -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 }} |
@ -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 }} | |||
@ -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 }} |
@ -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 |
@ -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 |
@ -0,0 +1,5 @@ | |||
apiVersion: v1 | |||
appVersion: "1.0" | |||
description: A Helm chart for Kubernetes | |||
name: apigwms | |||
version: 0.1.0 |
@ -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" | |||
} | |||
} | |||
@ -0,0 +1,2 @@ | |||
eShop API Gateway for Mobile Shopping services installed | |||
-------------------------------------------------------- |
@ -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 -}} |
@ -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 -}} |
@ -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 | |||
@ -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 }} | |||
@ -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 }} |
@ -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 }} | |||
@ -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 }} |
@ -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 |
@ -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 |
@ -0,0 +1,5 @@ | |||
apiVersion: v1 | |||
appVersion: "1.0" | |||
description: A Helm chart for Kubernetes | |||
name: apigwwm | |||
version: 0.1.0 |
@ -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" | |||
} | |||
} | |||
@ -0,0 +1,2 @@ | |||
eShop API Gateway for Web Marketing services installed | |||
------------------------------------------------------ |
@ -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 -}} |
@ -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 -}} |
@ -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 | |||
@ -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 }} | |||
@ -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 }} |
@ -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 -}} | |||
@ -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 }} |
@ -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 |
@ -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 |
@ -0,0 +1,5 @@ | |||
apiVersion: v1 | |||
appVersion: "1.0" | |||
description: A Helm chart for Kubernetes | |||
name: apigwws | |||
version: 0.1.0 |
@ -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" | |||
} | |||
} | |||
@ -0,0 +1,2 @@ | |||
eShop API Gateway for Web Shopping services installed | |||
----------------------------------------------------- |
@ -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 -}} |
@ -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 -}} |
@ -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 | |||
@ -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 }} | |||
@ -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 }} |
@ -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 }} | |||
@ -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 }} |
@ -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 |
@ -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 |
@ -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 |
@ -0,0 +1,5 @@ | |||
apiVersion: v1 | |||
appVersion: "1.0" | |||
description: A Helm chart for Kubernetes | |||
name: basket-api | |||
version: 0.1.0 |
@ -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 |
@ -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 -}} |
@ -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 -}} |