Browse Source

Merge pull request #67 from dotnet-architecture/dev

update eShopOnContainers forrk
pull/1934/head
Taras Kovalenko 2 years ago
committed by GitHub
parent
commit
657584cbfe
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1074 changed files with 103168 additions and 47926 deletions
  1. +8
    -23
      .github/workflows/basket-api-deploy.yml
  2. +14
    -88
      .github/workflows/basket-api.yml
  3. +8
    -23
      .github/workflows/catalog-api-deploy.yml
  4. +20
    -88
      .github/workflows/catalog-api.yml
  5. +71
    -0
      .github/workflows/composite/build-push/action.yml
  6. +47
    -0
      .github/workflows/composite/build-test/action.yml
  7. +21
    -0
      .github/workflows/composite/build/action.yml
  8. +54
    -0
      .github/workflows/composite/deploy-helm/action.yml
  9. +8
    -23
      .github/workflows/identity-api-deploy.yml
  10. +16
    -56
      .github/workflows/identity-api.yml
  11. +8
    -23
      .github/workflows/mobileshoppingagg-deploy.yml
  12. +16
    -56
      .github/workflows/mobileshoppingagg.yml
  13. +8
    -23
      .github/workflows/ordering-api-deploy.yml
  14. +20
    -88
      .github/workflows/ordering-api.yml
  15. +8
    -23
      .github/workflows/ordering-backgroundtasks-deploy.yml
  16. +16
    -56
      .github/workflows/ordering-backgroundtasks.yml
  17. +8
    -23
      .github/workflows/ordering-signalrhub-deploy.yml
  18. +16
    -56
      .github/workflows/ordering-signalrhub.yml
  19. +8
    -23
      .github/workflows/payment-api-deploy.yml
  20. +16
    -56
      .github/workflows/payment-api.yml
  21. +8
    -23
      .github/workflows/webhooks-api-deploy.yml
  22. +16
    -56
      .github/workflows/webhooks-api.yml
  23. +16
    -56
      .github/workflows/webhooks-client.yml
  24. +8
    -19
      .github/workflows/webmvc-deploy.yml
  25. +16
    -56
      .github/workflows/webmvc.yml
  26. +8
    -23
      .github/workflows/webshoppingagg-deploy.yml
  27. +16
    -56
      .github/workflows/webshoppingagg.yml
  28. +8
    -23
      .github/workflows/webspa-deploy.yml
  29. +16
    -56
      .github/workflows/webspa.yml
  30. +8
    -23
      .github/workflows/webstatus-deploy.yml
  31. +16
    -56
      .github/workflows/webstatus.yml
  32. +13
    -11
      README.md
  33. +5
    -2
      branch-guide.md
  34. +0
    -2
      build/acr-build/queue-all.ps1
  35. +63
    -0
      deploy/azure/az/servicebus/sbusdeploy.json
  36. +0
    -8
      deploy/k8s/archived/README.md
  37. +0
    -50
      deploy/k8s/archived/create-aks.ps1
  38. +0
    -18
      deploy/k8s/archived/dashboard-adminuser.yaml
  39. +0
    -20
      deploy/k8s/archived/enable-tls.ps1
  40. +0
    -18
      deploy/k8s/archived/helm-rbac.yaml
  41. +0
    -12
      deploy/k8s/archived/helm/aks-httpaddon-cfg.yaml
  42. +0
    -21
      deploy/k8s/archived/helm/apigwms/.helmignore
  43. +0
    -5
      deploy/k8s/archived/helm/apigwms/Chart.yaml
  44. +0
    -139
      deploy/k8s/archived/helm/apigwms/envoy.yaml
  45. +0
    -2
      deploy/k8s/archived/helm/apigwms/templates/NOTES.txt
  46. +0
    -32
      deploy/k8s/archived/helm/apigwms/templates/_helpers.tpl
  47. +0
    -52
      deploy/k8s/archived/helm/apigwms/templates/_names.tpl
  48. +0
    -110
      deploy/k8s/archived/helm/apigwms/templates/deployment.yaml
  49. +0
    -14
      deploy/k8s/archived/helm/apigwms/templates/envoy-cm.yaml
  50. +0
    -47
      deploy/k8s/archived/helm/apigwms/templates/ingress.yaml
  51. +0
    -23
      deploy/k8s/archived/helm/apigwms/templates/service.yaml
  52. +0
    -45
      deploy/k8s/archived/helm/apigwms/values.yaml
  53. +0
    -21
      deploy/k8s/archived/helm/apigwws/.helmignore
  54. +0
    -5
      deploy/k8s/archived/helm/apigwws/Chart.yaml
  55. +0
    -139
      deploy/k8s/archived/helm/apigwws/envoy.yaml
  56. +0
    -2
      deploy/k8s/archived/helm/apigwws/templates/NOTES.txt
  57. +0
    -32
      deploy/k8s/archived/helm/apigwws/templates/_helpers.tpl
  58. +0
    -52
      deploy/k8s/archived/helm/apigwws/templates/_names.tpl
  59. +0
    -109
      deploy/k8s/archived/helm/apigwws/templates/deployment.yaml
  60. +0
    -14
      deploy/k8s/archived/helm/apigwws/templates/envoy-cm.yaml
  61. +0
    -46
      deploy/k8s/archived/helm/apigwws/templates/ingress.yaml
  62. +0
    -23
      deploy/k8s/archived/helm/apigwws/templates/service.yaml
  63. +0
    -46
      deploy/k8s/archived/helm/apigwws/values.yaml
  64. +0
    -38
      deploy/k8s/archived/helm/app.yaml
  65. +0
    -21
      deploy/k8s/archived/helm/basket-api/.helmignore
  66. +0
    -5
      deploy/k8s/archived/helm/basket-api/Chart.yaml
  67. +0
    -8
      deploy/k8s/archived/helm/basket-api/templates/NOTES.txt
  68. +0
    -32
      deploy/k8s/archived/helm/basket-api/templates/_helpers.tpl
  69. +0
    -52
      deploy/k8s/archived/helm/basket-api/templates/_names.tpl
  70. +0
    -17
      deploy/k8s/archived/helm/basket-api/templates/configmap.yaml
  71. +0
    -99
      deploy/k8s/archived/helm/basket-api/templates/deployment.yaml
  72. +0
    -23
      deploy/k8s/archived/helm/basket-api/templates/service.yaml
  73. +0
    -61
      deploy/k8s/archived/helm/basket-api/values.yaml
  74. +0
    -21
      deploy/k8s/archived/helm/basket-data/.helmignore
  75. +0
    -5
      deploy/k8s/archived/helm/basket-data/Chart.yaml
  76. +0
    -8
      deploy/k8s/archived/helm/basket-data/templates/NOTES.txt
  77. +0
    -32
      deploy/k8s/archived/helm/basket-data/templates/_helpers.tpl
  78. +0
    -43
      deploy/k8s/archived/helm/basket-data/templates/deployment.yaml
  79. +0
    -19
      deploy/k8s/archived/helm/basket-data/templates/service.yaml
  80. +0
    -19
      deploy/k8s/archived/helm/basket-data/values.yaml
  81. +0
    -21
      deploy/k8s/archived/helm/catalog-api/.helmignore
  82. +0
    -5
      deploy/k8s/archived/helm/catalog-api/Chart.yaml
  83. +0
    -9
      deploy/k8s/archived/helm/catalog-api/templates/NOTES.txt
  84. +0
    -32
      deploy/k8s/archived/helm/catalog-api/templates/_helpers.tpl
  85. +0
    -60
      deploy/k8s/archived/helm/catalog-api/templates/_names.tpl
  86. +0
    -21
      deploy/k8s/archived/helm/catalog-api/templates/configmap.yaml
  87. +0
    -99
      deploy/k8s/archived/helm/catalog-api/templates/deployment.yaml
  88. +0
    -23
      deploy/k8s/archived/helm/catalog-api/templates/service.yaml
  89. +0
    -63
      deploy/k8s/archived/helm/catalog-api/values.yaml
  90. +0
    -149
      deploy/k8s/archived/helm/deploy-all.ps1
  91. +0
    -232
      deploy/k8s/archived/helm/deploy-all.sh
  92. +0
    -21
      deploy/k8s/archived/helm/eshop-common/.helmignore
  93. +0
    -5
      deploy/k8s/archived/helm/eshop-common/Chart.yaml
  94. +0
    -7
      deploy/k8s/archived/helm/eshop-common/templates/NOTES.txt
  95. +0
    -32
      deploy/k8s/archived/helm/eshop-common/templates/_helpers.tpl
  96. +0
    -3
      deploy/k8s/archived/helm/eshop-common/templates/_names.tpl
  97. +0
    -9
      deploy/k8s/archived/helm/eshop-common/templates/secret.yaml
  98. +0
    -0
      deploy/k8s/archived/helm/eshop-common/values.yaml
  99. +0
    -21
      deploy/k8s/archived/helm/identity-api/.helmignore
  100. +0
    -5
      deploy/k8s/archived/helm/identity-api/Chart.yaml

+ 8
- 23
.github/workflows/basket-api-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 14
- 88
.github/workflows/basket-api.yml View File

@ -22,7 +22,6 @@ on:
env:
SERVICE: basket-api
IMAGE: basket.api
DOTNET_VERSION: 5.0.x
jobs:
@ -30,97 +29,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Basket/Basket.API
dotnet build --no-restore
cd -
cd Services/Basket/Basket.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Basket/Basket.API
dotnet build --no-restore
cd -
cd Services/Basket/Basket.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/catalog-api-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 20
- 88
.github/workflows/catalog-api.yml View File

@ -22,7 +22,9 @@ on:
env:
SERVICE: catalog-api
IMAGE: catalog.api
DOTNET_VERSION: 5.0.x
DOTNET_VERSION: 6.0.x
PROJECT_PATH: Services/Catalog/Catalog.API
TESTS_PATH: Services/Catalog/Catalog.UnitTests
jobs:
@ -30,97 +32,27 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-test
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Catalog/Catalog.API
dotnet build --no-restore
cd -
cd Services/Catalog/Catalog.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
dotnet_version: ${{ env.DOTNET_VERSION }}
project_path: ${{ env.PROJECT_PATH }}
tests_path: ${{ env.TESTS_PATH }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Catalog/Catalog.API
dotnet build --no-restore
cd -
cd Services/Catalog/Catalog.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 71
- 0
.github/workflows/composite/build-push/action.yml View File

@ -0,0 +1,71 @@
name: "Build and push image"
description: "Builds and pushes an image to a registry"
inputs:
service:
description: "Service to build"
required: true
registry_host:
description: "Image registry host e.g. myacr.azureacr.io"
required: true
registry_endpoint:
description: "Image registry repo e.g. myacr.azureacr.io/eshop"
required: true
image_name:
description: "Name of image"
required: true
registry_username:
description: "Registry username"
required: true
registry_password:
description: "Registry password"
required: true
runs:
using: "composite"
steps:
- name: Enable experimental features for the Docker daemon and CLI
shell: bash
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
with:
registry: ${{ inputs.registry_host }}
username: ${{ inputs.registry_username }}
password: ${{ inputs.registry_password }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ inputs.service }}
shell: bash
run: sudo -E docker-compose build ${{ inputs.service }}
working-directory: ./src
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ inputs.registry_endpoint }}
- name: Compose push ${{ inputs.service }}
shell: bash
run: sudo -E docker-compose push ${{ inputs.service }}
working-directory: ./src
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ inputs.registry_endpoint }}
- name: Create multiarch manifest
shell: bash
run: |
docker --config ~/.docker manifest create ${{ inputs.registry_endpoint }}/${{ inputs.image_name }}:${{ env.BRANCH }} ${{ inputs.registry_endpoint }}/${{ inputs.image_name }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ inputs.registry_endpoint }}/${{ inputs.image_name }}:${{ env.BRANCH }}

+ 47
- 0
.github/workflows/composite/build-test/action.yml View File

@ -0,0 +1,47 @@
name: "Build for PRe"
description: "Builds a docker image without pushing"
inputs:
service:
description: "Service to build"
required: true
registry_endpoint:
description: "Image registry repo e.g. myacr.azureacr.io/eshop"
required: true
dotnet_version:
description: "Version of dotnet to use for testing"
required: true
project_path:
description: "Path to project to test e.g. Services/Catalog/Catalog.API"
required: true
tests_path:
description: "Path to test project e.g. Services/Catalog/Catalog.UnitTests"
required: true
runs:
using: "composite"
steps:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ inputs.dotnet_version }}
- name: Build and run unit tests
shell: bash
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd ${{ inputs.project_path }}
dotnet build --no-restore
cd -
cd ${{ inputs.tests_path }}
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Compose build ${{ inputs.service }}
shell: bash
run: sudo -E docker-compose build ${{ inputs.service }}
working-directory: ./src
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ inputs.registry_endpoint }}

+ 21
- 0
.github/workflows/composite/build/action.yml View File

@ -0,0 +1,21 @@
name: "Build for PRe"
description: "Builds a docker image without pushing"
inputs:
service:
description: "Service to build"
required: true
registry_endpoint:
description: "Image registry repo e.g. myacr.azureacr.io/eshop"
required: true
runs:
using: "composite"
steps:
- name: Compose build ${{ inputs.service }}
shell: bash
run: sudo -E docker-compose build ${{ inputs.service }}
working-directory: ./src
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ inputs.registry_endpoint }}

+ 54
- 0
.github/workflows/composite/deploy-helm/action.yml View File

@ -0,0 +1,54 @@
name: "Deploy Helm to AKS"
description: "Deploys a helm chart to AKS"
inputs:
azure_credentials:
description: "Credentials to connect to AKS"
required: true
cluster_name:
description: "Name of AKS cluster"
required: true
resource_group:
description: "Resource group of AKS cluster"
required: true
registry_host:
description: "Image registry host e.g. myacr.azureacr.io"
required: true
chart:
description: "Chart name"
required: true
chart_root:
description: "Root folder of chart"
required: true
namespace:
description: "Namespace to deploy to"
required: true
runs:
using: "composite"
steps:
- uses: azure/login@v1
with:
creds: ${{ inputs.azure_credentials }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ inputs.azure_credentials }}'
cluster-name: ${{ inputs.cluster_name }}
resource-group: ${{ inputs.resource_group }}
- name: Set branch name as env variable
shell: bash
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
- name: Deploy Chart
shell: bash
run: |
./deploy-chart.sh -c ${{ inputs.chart }} --dns aks --aks-name ${{ inputs.clusteR_name }} --aks-rg ${{ inputs.resource_group }} -r ${{ inputs.registry_host }} -t $TAG --namespace ${{ inputs.namespace }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ inputs.chart_root }}

+ 8
- 23
.github/workflows/identity-api-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/identity-api.yml View File

@ -1,6 +1,7 @@
name: identity-api
on:
workflow_dispatch:
push:
branches:
- dev
@ -28,65 +29,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/mobileshoppingagg-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/mobileshoppingagg.yml View File

@ -1,6 +1,7 @@
name: mobileshoppingagg
on:
workflow_dispatch:
push:
branches:
- dev
@ -26,65 +27,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/ordering-api-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 20
- 88
.github/workflows/ordering-api.yml View File

@ -22,7 +22,9 @@ on:
env:
SERVICE: ordering-api
IMAGE: ordering.api
DOTNET_VERSION: 5.0.x
DOTNET_VERSION: 6.0.x
PROJECT_PATH: Services/Ordering/Ordering.API
TESTS_PATH: Services/Ordering/Ordering.UnitTests
jobs:
@ -30,97 +32,27 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-test
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Ordering/Ordering.API
dotnet build --no-restore
cd -
cd Services/Ordering/Ordering.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
dotnet_version: ${{ env.DOTNET_VERSION }}
project_path: ${{ env.PROJECT_PATH }}
tests_path: ${{ env.TESTS_PATH }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build and run unit tests
run: |
cd src
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
cd Services/Ordering/Ordering.API
dotnet build --no-restore
cd -
cd Services/Ordering/Ordering.UnitTests
dotnet build --no-restore
dotnet test --no-build -v=normal
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/ordering-backgroundtasks-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/ordering-backgroundtasks.yml View File

@ -1,6 +1,7 @@
name: ordering-backgroundtasks
on:
workflow_dispatch:
push:
branches:
- dev
@ -28,65 +29,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/ordering-signalrhub-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/ordering-signalrhub.yml View File

@ -1,6 +1,7 @@
name: ordering-signalrhub
on:
workflow_dispatch:
push:
branches:
- dev
@ -28,65 +29,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/payment-api-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/payment-api.yml View File

@ -1,6 +1,7 @@
name: payment-api
on:
workflow_dispatch:
push:
branches:
- dev
@ -28,65 +29,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/webhooks-api-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/webhooks-api.yml View File

@ -1,6 +1,7 @@
name: webhooks-api
on:
workflow_dispatch:
push:
branches:
- dev
@ -28,65 +29,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 16
- 56
.github/workflows/webhooks-client.yml View File

@ -1,6 +1,7 @@
name: webhooks-client
on:
workflow_dispatch:
push:
branches:
- dev
@ -28,65 +29,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 19
.github/workflows/webmvc-deploy.yml View File

@ -28,23 +28,12 @@ jobs:
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/webmvc.yml View File

@ -1,6 +1,7 @@
name: webmvc
on:
workflow_dispatch:
push:
branches:
- dev
@ -29,65 +30,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/webshoppingagg-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/webshoppingagg.yml View File

@ -1,6 +1,7 @@
name: webshoppingagg
on:
workflow_dispatch:
push:
branches:
- dev
@ -26,65 +27,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/webspa-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/webspa.yml View File

@ -1,6 +1,7 @@
name: webspa
on:
workflow_dispatch:
push:
branches:
- dev
@ -28,65 +29,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 8
- 23
.github/workflows/webstatus-deploy.yml View File

@ -24,27 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
- uses: ./.github/workflows/composite/deploy-helm
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v1
name: Set AKS context
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Deploy Chart
run: |
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
env:
TAG: ${{ env.BRANCH }}
working-directory: ${{ env.CHART_ROOT }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
cluster_name: ${{ secrets.CLUSTER_NAME }}
resource_group: ${{ secrets.RESOURCE_GROUP }}
registry_host: ${{ secrets.REGISTRY_HOST }}
chart: ${{ env.CHART }}
chart_root: ${{ env.CHART_ROOT }}
namespace: ${{ env.NAMESPACE }}

+ 16
- 56
.github/workflows/webstatus.yml View File

@ -1,6 +1,7 @@
name: webstatus
on:
workflow_dispatch:
push:
branches:
- dev
@ -29,65 +30,24 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build
with:
service: ${{ env.SERVICE }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
BuildLinux:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Enable experimental features for the Docker daemon and CLI
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
mkdir -p ~/.docker
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
sudo service docker restart
docker version -f '{{.Client.Experimental}}'
docker version -f '{{.Server.Experimental}}'
- name: Login to Container Registry
uses: docker/login-action@v1
- name: Checkout code
uses: actions/checkout@v2
- uses: ./.github/workflows/composite/build-push
with:
registry: ${{ secrets.REGISTRY_HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Set branch name as env variable
run: |
currentbranch=$(echo ${GITHUB_REF##*/})
echo "running on $currentbranch"
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
shell: bash
- name: Compose build ${{ env.SERVICE }}
run: sudo -E docker-compose build ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Compose push ${{ env.SERVICE }}
run: sudo -E docker-compose push ${{ env.SERVICE }}
working-directory: ./src
shell: bash
env:
TAG: ${{ env.BRANCH }}
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
- name: Create multiarch manifest
run: |
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
shell: bash
service: ${{ env.SERVICE }}
registry_host: ${{ secrets.REGISTRY_HOST }}
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
image_name: ${{ env.IMAGE }}
registry_username: ${{ secrets.USERNAME }}
registry_password: ${{ secrets.PASSWORD }}

+ 13
- 11
README.md View File

@ -6,7 +6,9 @@
Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
![](img/eshop-webmvc-app-screenshot.png)
## SPA Application (Angular)
![](img/eshop-spa-app-home.png)
## Build Status (GitHub Actions)
@ -54,25 +56,25 @@ The basic scenario can be run locally using docker-compose, and also deployed to
### Advanced scenario
The Advanced scenario can be run only in a Kubernetes cluster. Currently this scenario is the same as a basic scenario with the following differences:
The Advanced scenario can be run only in a Kubernetes cluster. Currently, this scenario is the same as a basic scenario with the following differences:
- [Deploy to AKS with a Service Mesh for resiliency](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Deploy-to-Azure-Kubernetes-Service-(AKS))
In the future more features will be implemented in the advanced scenario.
In the future, more features will be implemented in the advanced scenario.
## IMPORTANT NOTES!
**You can use either the latest version of Visual Studio or simply Docker CLI and .NET CLI for Windows, Mac and Linux**.
**You can use either the latest version of Visual Studio or simply Docker CLI and .NET CLI for Windows, Mac, and Linux**.
**Note for Pull Requests (PRs)**: We accept pull request from the community. When doing it, please do it onto the **DEV branch** which is the consolidated work-in-progress branch. Do not request it onto **master** branch.
**Note for Pull Requests (PRs)**: We accept pull requests from the community. When doing it, please do it onto the **DEV branch** which is the consolidated work-in-progress branch. Do not request it onto **main** branch.
**NEWS / ANNOUNCEMENTS**
Do you want to be up-to-date on .NET Architecture guidance and reference apps like eShopOnContainers? --> Subscribe by "WATCHING" this new GitHub repo: https://github.com/dotnet-architecture/News
## Updated for .NET 5
## Updated for .NET 6
eShopOnContainers is updated to .NET 5 "wave" of technologies. Not just compilation but also new recommended code in EF Core, ASP.NET Core, and other new related versions with several significant changes.
eShopOnContainers is updated to .NET 6 "wave" of technologies. Not just compilation but also new recommended code in EF Core, ASP.NET Core, and other new related versions with several significant changes.
**See more details in the [Release notes](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Release-notes) wiki page**.
@ -84,15 +86,15 @@ eShopOnContainers is updated to .NET 5 "wave" of technologies. Not just compilat
### Architecture overview
This reference application is cross-platform at the server and client side, thanks to .NET 5 services capable of running on Linux or Windows containers depending on your Docker host, and to Xamarin for mobile apps running on Android, iOS or Windows/UWP plus any browser for the client web apps.
The architecture proposes a microservice oriented architecture implementation with multiple autonomous microservices (each one owning its own data/db) and implementing different approaches within each microservice (simple CRUD vs. DDD/CQRS patterns) using Http as the communication protocol between the client apps and the microservices and supports asynchronous communication for data updates propagation across multiple services based on Integration Events and an Event Bus (a light message broker, to choose between RabbitMQ or Azure Service Bus, underneath) plus other features defined at the [roadmap](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Roadmap).
This reference application is cross-platform at the server and client-side, thanks to .NET 6 services capable of running on Linux or Windows containers depending on your Docker host, and to Xamarin for mobile apps running on Android, iOS, or Windows/UWP plus any browser for the client web apps.
The architecture proposes a microservice oriented architecture implementation with multiple autonomous microservices (each one owning its own data/db) and implementing different approaches within each microservice (simple CRUD vs. DDD/CQRS patterns) using HTTP as the communication protocol between the client apps and the microservices and supports asynchronous communication for data updates propagation across multiple services based on Integration Events and an Event Bus (a light message broker, to choose between RabbitMQ or Azure Service Bus, underneath) plus other features defined at the [roadmap](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Roadmap).
![](img/eshop_logo.png)
![](img/eShopOnContainers-architecture.png)
## Related documentation and guidance
You can find the related reference **Guide/eBook** focusing on **architecting and developing containerized and microservice based .NET Applications** (download link available below) which explains in detail how to develop this kind of architectural style (microservices, Docker containers, Domain-Driven Design for certain microservices) plus other simpler architectural styles, like monolithic apps that can also live as Docker containers.
You can find the related reference **Guide/eBook** focusing on **architecting and developing containerized and microservice-based .NET Applications** (download link available below) which explains in detail how to develop this kind of architectural style (microservices, Docker containers, Domain-Driven Design for certain microservices) plus other simpler architectural styles, like monolithic apps that can also live as Docker containers.
There are also additional eBooks focusing on Containers/Docker lifecycle (DevOps, CI/CD, etc.) with Microsoft Tools, already published plus an additional eBook focusing on Enterprise Apps Patterns with Xamarin.Forms.
You can download them and start reviewing these Guides/eBooks here:
@ -105,7 +107,7 @@ You can download them and start reviewing these Guides/eBooks here:
For more free e-Books check out [.NET Architecture center](https://dot.net/architecture). If you have an e-book feedback, let us know by creating a new issue here: <https://github.com/dotnet-architecture/ebooks/issues>
## Are you new to **microservices** and **cloud-native development**?
Take a look at the free course [Create and deploy a cloud-native ASP.NET Core microservice](https://docs.microsoft.com/en-us/learn/modules/microservices-aspnet-core/) on MS Learn. This module explains microservices concepts, cloud-native technologies, and reduce the friction in getting started with `eShopOnContainers`.
Take a look at the free course [Create and deploy a cloud-native ASP.NET Core microservice](https://docs.microsoft.com/en-us/learn/modules/microservices-aspnet-core/) on MS Learn. This module explains microservices concepts, cloud-native technologies, and reduces the friction in getting started with `eShopOnContainers`.
## Read further


+ 5
- 2
branch-guide.md View File

@ -2,8 +2,11 @@
Following are the most important branches:
- `dev`: Contains the latest code **and it is the branch actively developed**. Note that **all PRs must be against the `dev` branch to be considered**. This branch is developed using `.NET 5`
- `main`: Synced time to time from `dev`.It contains "stable" code, although not the latest one. Right now, this branch contains changes specific to `.NET Core 3.1`
- `dev`: Contains the latest code **and it is the branch actively developed**. Note that **all PRs must be against the `dev` branch to be considered**. This branch is developed using `.NET 6`
- `release/net-5`: Contains the code changes specific to the `.NET 5`
- `release/net-3.1.1`: Contains the code changes specific to the `.NET 3.1`
> [!DISCLAIMER]: The `main` branch contains the old code base and will get obsolete in the future. So it's recommended to refer to different [tags](https://github.com/dotnet-architecture/eShopOnContainers/tags) to avoid any confusion.
Any other branch is considered temporary and could be deleted at any time. Do not submit any PR against them!


+ 0
- 2
build/acr-build/queue-all.ps1 View File

@ -31,5 +31,3 @@ $services |% {
Write-Host "Setting ACR build $bname ($bimg)"
az acr build-task create --registry $acrName --name $bname --image ${bimg}:$gitBranch --context $gitContext --branch $gitBranch --git-access-token $patToken --file $bfile
}
# Basket.API

+ 63
- 0
deploy/azure/az/servicebus/sbusdeploy.json View File

@ -16,6 +16,9 @@
"OrderingSubscriptionName": "Ordering",
"GracePeriodSubscriptionName": "GracePeriod",
"PaymentSubscriptionName": "Payment",
"BackgroundTaskSubscriptionName": "backgroundtasks",
"OrderingSignalrHubSubscriptionName": "Ordering.signalrhub",
"WebhooksSubscriptionName": "Webhooks",
"location": "[resourceGroup().location]",
"sbVersion": "2015-08-01",
"defaultSASKeyName": "Root",
@ -172,6 +175,66 @@
"autoDeleteOnIdle": "10675199.02:48:05.4775807",
"entityAvailabilityStatus": "Available"
}
},
{
"apiVersion": "[variables('sbVersion')]",
"name": "[variables('BackgroundTaskSubscriptionName')]",
"type": "Subscriptions",
"dependsOn": [
"[variables('serviceBusTopicName')]"
],
"properties": {
"lockDuration": "00:00:30",
"requiresSession": false,
"defaultMessageTimeToLive": "14.00:00:00",
"deadLetteringOnMessageExpiration": true,
"deadLetteringOnFilterEvaluationExceptions": true,
"maxDeliveryCount": 10,
"enableBatchedOperations": false,
"status": "Active",
"autoDeleteOnIdle": "10675199.02:48:05.4775807",
"entityAvailabilityStatus": "Available"
}
},
{
"apiVersion": "[variables('sbVersion')]",
"name": "[variables('OrderingSignalrHubSubscriptionName')]",
"type": "Subscriptions",
"dependsOn": [
"[variables('serviceBusTopicName')]"
],
"properties": {
"lockDuration": "00:00:30",
"requiresSession": false,
"defaultMessageTimeToLive": "14.00:00:00",
"deadLetteringOnMessageExpiration": true,
"deadLetteringOnFilterEvaluationExceptions": true,
"maxDeliveryCount": 10,
"enableBatchedOperations": false,
"status": "Active",
"autoDeleteOnIdle": "10675199.02:48:05.4775807",
"entityAvailabilityStatus": "Available"
}
},
{
"apiVersion": "[variables('sbVersion')]",
"name": "[variables('WebhooksSubscriptionName')]",
"type": "Subscriptions",
"dependsOn": [
"[variables('serviceBusTopicName')]"
],
"properties": {
"lockDuration": "00:00:30",
"requiresSession": false,
"defaultMessageTimeToLive": "14.00:00:00",
"deadLetteringOnMessageExpiration": true,
"deadLetteringOnFilterEvaluationExceptions": true,
"maxDeliveryCount": 10,
"enableBatchedOperations": false,
"status": "Active",
"autoDeleteOnIdle": "10675199.02:48:05.4775807",
"entityAvailabilityStatus": "Available"
}
}
]
}


+ 0
- 8
deploy/k8s/archived/README.md View File

@ -1,8 +0,0 @@
# Kubernetes deployment
This folder contains the files required to deploy eShopOnContainers to a Kubernetes cluster.
For more information see the following articles in the [wiki](https://github.com/dotnet-architecture/eShopOnContainers/wiki):
- [Deploy to Local Kubernetes](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Deploy-to-Local-Kubernetes)
- [Deploy to Azure Kubernetes Service (AKS)](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Deploy-to-Azure-Kubernetes-Service-(AKS))

+ 0
- 50
deploy/k8s/archived/create-aks.ps1 View File

@ -1,50 +0,0 @@
Param(
[parameter(Mandatory=$true)][string]$resourceGroupName,
[parameter(Mandatory=$true)][string]$location,
[parameter(Mandatory=$true)][string]$serviceName,
[parameter(Mandatory=$true)][string]$dnsNamePrefix,
[parameter(Mandatory=$false)][string]$registryName,
[parameter(Mandatory=$true)][bool]$createAcr=$true,
[parameter(Mandatory=$false)][int]$nodeCount=3,
[parameter(Mandatory=$false)][string]$nodeVMSize="Standard_D2_v2",
[parameter(Mandatory=$false)][bool]$enableHttpApplicationAddon=$true,
[parameter(Mandatory=$false)][bool]$enableAzureMonitoring=$false,
[parameter(Mandatory=$false)][ValidateSet("VirtualMachineScaleSets","AvailabilitySet",IgnoreCase=$true)]$vmSetType="VirtualMachineScaleSets"
)
# Create resource group
Write-Host "Creating Azure Resource Group..." -ForegroundColor Yellow
az group create --name=$resourceGroupName --location=$location
if ($createAcr -eq $true) {
# Create Azure Container Registry
if ([string]::IsNullOrEmpty($registryName)) {
$registryName=$serviceName
}
Write-Host "Creating Azure Container Registry named $registryName" -ForegroundColor Yellow
az acr create -n $registryName -g $resourceGroupName -l $location --admin-enabled true --sku Basic
}
# Create kubernetes cluster in AKS
Write-Host "Creating AKS $resourceGroupName/$serviceName" -ForegroundColor Yellow
az aks create --resource-group=$resourceGroupName --name=$serviceName --dns-name-prefix=$dnsNamePrefix --generate-ssh-keys --node-count=$nodeCount --node-vm-size=$nodeVMSize --vm-set-type $vmSetType
if ($enableHttpApplicationAddon) {
Write-Host "Enabling Http Applciation Routing in AKS $serviceName" -ForegroundColor Yellow
az aks enable-addons --resource-group $resourceGroupName --name $serviceName --addons http_application_routing
}
if ($enableAzureMonitoring) {
Write-Host "Enabling Azure Monitoring in AKS $serviceName" -ForegroundColor Yellow
az aks enable-addons --resource-group $resourceGroupName --name $serviceName --addons monitoring
}
# Retrieve kubernetes cluster configuration and save it under ~/.kube/config
Write-Host "Getting Kubernetes config..." -ForegroundColor Yellow
az aks get-credentials --resource-group=$resourceGroupName --name=$serviceName
if ($createAcr -eq $true) {
# Show ACR credentials
Write-Host "ACR $registryName credentials:" -ForegroundColor Yellow
az acr credential show -n $registryName
}

+ 0
- 18
deploy/k8s/archived/dashboard-adminuser.yaml View File

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

+ 0
- 20
deploy/k8s/archived/enable-tls.ps1 View File

@ -1,20 +0,0 @@
Param (
[parameter(Mandatory=$false)][string]$aksName="",
[parameter(Mandatory=$false)][string]$aksRg=""
)
if ($aksName -and $aksRg) {
$aks=$(az aks show -n $aksName -g $aksRg -o json | ConvertFrom-Json)
if (-not $aks) {
Write-Host "AKS $aksName not found in RG $aksRg" -ForegroundColor Red
exit 1
}
Write-Host "Switching kubectl context to $aksRg/$aksName" -ForegroundColor Yellow
az aks get-credentials -g $aksRg -n $aksName
}
Write-Host "Installing cert-manager on current cluster"
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.11.0/cert-manager.yaml --validate=false

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

@ -1,18 +0,0 @@
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
- 12
deploy/k8s/archived/helm/aks-httpaddon-cfg.yaml View File

@ -1,12 +0,0 @@
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
- 21
deploy/k8s/archived/helm/apigwms/.helmignore View File

@ -1,21 +0,0 @@
# 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
- 5
deploy/k8s/archived/helm/apigwms/Chart.yaml View File

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

+ 0
- 139
deploy/k8s/archived/helm/apigwms/envoy.yaml View File

@ -1,139 +0,0 @@
admin:
access_log_path: "/dev/null"
address:
socket_address:
address: 0.0.0.0
port_value: 8001
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 80
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
codec_type: auto
stat_prefix: ingress_http
route_config:
name: eshop_backend_route
virtual_hosts:
- name: eshop_backend
domains:
- "*"
routes:
- name: "c-short"
match:
prefix: "/c/"
route:
auto_host_rewrite: true
prefix_rewrite: "/catalog-api/"
cluster: catalog
- name: "c-long"
match:
prefix: "/catalog-api/"
route:
auto_host_rewrite: true
cluster: catalog
- name: "o-short"
match:
prefix: "/o/"
route:
auto_host_rewrite: true
prefix_rewrite: "/ordering-api/"
cluster: ordering
- name: "o-long"
match:
prefix: "/ordering-api/"
route:
auto_host_rewrite: true
cluster: ordering
- name: "h-long"
match:
prefix: "/hub/notificationhub"
route:
auto_host_rewrite: true
cluster: signalr-hub
timeout: 300s
- name: "b-short"
match:
prefix: "/b/"
route:
auto_host_rewrite: true
prefix_rewrite: "/basket-api/"
cluster: basket
- name: "b-long"
match:
prefix: "/basket-api/"
route:
auto_host_rewrite: true
cluster: basket
- name: "agg"
match:
prefix: "/"
route:
auto_host_rewrite: true
prefix_rewrite: "/"
cluster: shoppingagg
http_filters:
- name: envoy.router
access_log:
- name: envoy.file_access_log
filter:
not_health_check_filter: {}
config:
json_format:
time: "%START_TIME%"
protocol: "%PROTOCOL%"
duration: "%DURATION%"
request_method: "%REQ(:METHOD)%"
request_host: "%REQ(HOST)%"
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"
response_flags: "%RESPONSE_FLAGS%"
route_name: "%ROUTE_NAME%"
upstream_host: "%UPSTREAM_HOST%"
upstream_cluster: "%UPSTREAM_CLUSTER%"
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%"
path: "/tmp/access.log"
clusters:
- name: shoppingagg
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: webshoppingagg
port_value: 80
- name: catalog
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: catalog-api
port_value: 80
- name: basket
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: basket-api
port_value: 80
- name: ordering
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: ordering-api
port_value: 80
- name: signalr-hub
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: ordering-signalrhub
port_value: 80

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

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

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

@ -1,32 +0,0 @@
{{/* 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
- 52
deploy/k8s/archived/helm/apigwms/templates/_names.tpl View File

@ -1,52 +0,0 @@
{{- 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 -}}

+ 0
- 110
deploy/k8s/archived/helm/apigwms/templates/deployment.yaml View File

@ -1,110 +0,0 @@
{{- $name := include "apigwms.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
{{- $envoycfgname := printf "%s-%s" "envoy" $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 }}
{{ if .Values.inf.mesh.enabled -}}
annotations:
linkerd.io/inject: enabled
{{- end }}
spec:
{{ if .Values.inf.registry -}}
imagePullSecrets:
- name: {{ .Values.inf.registry.secretName }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ $envoycfgname }}
items:
- key: envoy.yaml
path: envoy.yaml
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: IfNotPresent
volumeMounts:
- name: config
mountPath: {{ .Values.envoy.configPath }}
env:
- name: PATH_BASE
value: {{ include "pathBase" . }}
- 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
- name: admin
containerPort: 8001
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
- 14
deploy/k8s/archived/helm/apigwms/templates/envoy-cm.yaml View File

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

+ 0
- 47
deploy/k8s/archived/helm/apigwms/templates/ingress.yaml View File

@ -1,47 +0,0 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.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 }}
{{- if and .Values.inf.tls.enabled .Values.inf.tls.issuer }}
cert-manager.io/issuer: {{ .Values.inf.tls.issuer }}
{{- end }}
{{- if .Values.inf.mesh.enabled }}
{{- with .Values.ingress.mesh.annotations }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 0
- 23
deploy/k8s/archived/helm/apigwms/templates/service.yaml View File

@ -1,23 +0,0 @@
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
- port: {{ .Values.service.adminPort }}
targetPort: admin
protocol: TCP
name: admin
selector:
app: {{ template "apigwms.name" . }}
release: {{ .Release.Name }}

+ 0
- 45
deploy/k8s/archived/helm/apigwms/values.yaml View File

@ -1,45 +0,0 @@
replicaCount: 1
clusterName: eshop-aks
pathBase: /mobileshoppingapigw
image:
repository: envoyproxy/envoy
tag: v1.11.1
service:
type: ClusterIP
port: 80
adminPort: 8001
ingress:
enabled: true
annotations:
nginx.ingress.kubernetes.io/rewrite-target: "/"
ingress.kubernetes.io/rewrite-target: "/"
tls: []
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
env: {}
envoy:
configPath: /etc/envoy
probes:
liveness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 15
port: 8001
readiness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 60
port: 8001

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

@ -1,21 +0,0 @@
# 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
- 5
deploy/k8s/archived/helm/apigwws/Chart.yaml View File

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

+ 0
- 139
deploy/k8s/archived/helm/apigwws/envoy.yaml View File

@ -1,139 +0,0 @@
admin:
access_log_path: "/dev/null"
address:
socket_address:
address: 0.0.0.0
port_value: 8001
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 80
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
codec_type: auto
stat_prefix: ingress_http
route_config:
name: eshop_backend_route
virtual_hosts:
- name: eshop_backend
domains:
- "*"
routes:
- name: "c-short"
match:
prefix: "/c/"
route:
auto_host_rewrite: true
prefix_rewrite: "/catalog-api/"
cluster: catalog
- name: "c-long"
match:
prefix: "/catalog-api/"
route:
auto_host_rewrite: true
cluster: catalog
- name: "o-short"
match:
prefix: "/o/"
route:
auto_host_rewrite: true
prefix_rewrite: "/ordering-api/"
cluster: ordering
- name: "o-long"
match:
prefix: "/ordering-api/"
route:
auto_host_rewrite: true
cluster: ordering
- name: "h-long"
match:
prefix: "/hub/notificationhub"
route:
auto_host_rewrite: true
cluster: signalr-hub
timeout: 300s
- name: "b-short"
match:
prefix: "/b/"
route:
auto_host_rewrite: true
prefix_rewrite: "/basket-api/"
cluster: basket
- name: "b-long"
match:
prefix: "/basket-api/"
route:
auto_host_rewrite: true
cluster: basket
- name: "agg"
match:
prefix: "/"
route:
auto_host_rewrite: true
prefix_rewrite: "/"
cluster: shoppingagg
http_filters:
- name: envoy.router
access_log:
- name: envoy.file_access_log
filter:
not_health_check_filter: {}
config:
json_format:
time: "%START_TIME%"
protocol: "%PROTOCOL%"
duration: "%DURATION%"
request_method: "%REQ(:METHOD)%"
request_host: "%REQ(HOST)%"
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"
response_flags: "%RESPONSE_FLAGS%"
route_name: "%ROUTE_NAME%"
upstream_host: "%UPSTREAM_HOST%"
upstream_cluster: "%UPSTREAM_CLUSTER%"
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%"
path: "/tmp/access.log"
clusters:
- name: shoppingagg
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: webshoppingagg
port_value: 80
- name: catalog
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: catalog-api
port_value: 80
- name: basket
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: basket-api
port_value: 80
- name: ordering
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: ordering-api
port_value: 80
- name: signalr-hub
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
hosts:
- socket_address:
address: ordering-signalrhub
port_value: 80

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

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

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

@ -1,32 +0,0 @@
{{/* 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
- 52
deploy/k8s/archived/helm/apigwws/templates/_names.tpl View File

@ -1,52 +0,0 @@
{{- 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 -}}

+ 0
- 109
deploy/k8s/archived/helm/apigwws/templates/deployment.yaml View File

@ -1,109 +0,0 @@
{{- $name := include "apigwws.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
{{- $envoycfgname := printf "%s-%s" "envoy" $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 }}
{{ if .Values.inf.mesh.enabled -}}
annotations:
linkerd.io/inject: enabled
{{- end }}
spec:
{{ if .Values.inf.registry -}}
imagePullSecrets:
- name: {{ .Values.inf.registry.secretName }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ $envoycfgname }}
items:
- key: envoy.yaml
path: envoy.yaml
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: {{ .Values.envoy.configPath }}
env:
- name: PATH_BASE
value: {{ include "pathBase" . }}
- 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
- name: admin
containerPort: 8001
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
- 14
deploy/k8s/archived/helm/apigwws/templates/envoy-cm.yaml View File

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

+ 0
- 46
deploy/k8s/archived/helm/apigwws/templates/ingress.yaml View File

@ -1,46 +0,0 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.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 }}
{{- if and .Values.inf.tls.enabled .Values.inf.tls.issuer }}
cert-manager.io/issuer: {{ .Values.inf.tls.issuer }}
{{- end }}
{{- if .Values.inf.mesh.enabled }}
{{- with .Values.ingress.mesh.annotations }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 0
- 23
deploy/k8s/archived/helm/apigwws/templates/service.yaml View File

@ -1,23 +0,0 @@
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
- port: {{ .Values.service.adminPort }}
targetPort: admin
protocol: TCP
name: admin
selector:
app: {{ template "apigwws.name" . }}
release: {{ .Release.Name }}

+ 0
- 46
deploy/k8s/archived/helm/apigwws/values.yaml View File

@ -1,46 +0,0 @@
replicaCount: 1
clusterName: eshop-aks
pathBase: /webshoppingapigw
image:
repository: envoyproxy/envoy
tag: v1.11.1
service:
type: ClusterIP
port: 80
adminPort: 8001
ingress:
enabled: true
annotations:
nginx.ingress.kubernetes.io/rewrite-target: "/"
ingress.kubernetes.io/rewrite-target: "/"
tls: []
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
# env defines the environment variables that will be declared in the pod
env: {}
envoy:
configPath: /etc/envoy
probes:
liveness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 15
port: 8001
readiness:
path: /ready
initialDelaySeconds: 5
periodSeconds: 60
port: 8001

+ 0
- 38
deploy/k8s/archived/helm/app.yaml View File

@ -1,38 +0,0 @@
# 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
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
webhooks: webhooks-api # ingress entry for webhooks api
webhooksweb: webhooks-web # ingress entry for webhooks web demo client
svc:
basket: basket-api # service name for basket api
catalog: catalog-api # service name for catalog api
ordering: ordering-api # service name for ordering api
orderingbackgroundtasks: ordering-backgroundtasks # service name for orderingbackgroundtasks
orderingsignalrhub: ordering-signalrhub # service name for orderingsignalrhub
identity: identity-api # 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
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-api # service name for payment api
webhooks: webhooks-api # service name for webhooks api
webhooksweb: webhooks-client # service name for webhooks web

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

@ -1,21 +0,0 @@
# 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
- 5
deploy/k8s/archived/helm/basket-api/Chart.yaml View File

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

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

@ -1,8 +0,0 @@
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
- 32
deploy/k8s/archived/helm/basket-api/templates/_helpers.tpl View File

@ -1,32 +0,0 @@
{{/* 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
- 52
deploy/k8s/archived/helm/basket-api/templates/_names.tpl View File

@ -1,52 +0,0 @@
{{- 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 -}}

+ 0
- 17
deploy/k8s/archived/helm/basket-api/templates/configmap.yaml View File

@ -1,17 +0,0 @@
{{- $name := include "basket-api.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "cfg-{{ $name }}"
labels:
app: {{ template "basket-api.name" . }}
chart: {{ template "basket-api.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
basket__ConnectionString: {{ .Values.inf.redis.basket.constr }}
urls__IdentityUrl: http://{{ .Values.app.svc.identity }}
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

+ 0
- 99
deploy/k8s/archived/helm/basket-api/templates/deployment.yaml View File

@ -1,99 +0,0 @@
{{- $name := include "basket-api.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "basket-api.fullname" . }}
labels:
ufo: {{ $cfgname}}
app: {{ template "basket-api.name" . }}
chart: {{ template "basket-api.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "basket-api.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "basket-api.name" . }}
release: {{ .Release.Name }}
{{ if .Values.inf.mesh.enabled -}}
annotations:
linkerd.io/inject: enabled
{{- end }}
spec:
{{ if .Values.inf.registry -}}
imagePullSecrets:
- name: {{ .Values.inf.registry.secretName }}
{{- end }}
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 }}
env:
- name: PATH_BASE
value: {{ include "pathBase" . }}
- 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
- name: grpc
containerPort: 81
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
- 23
deploy/k8s/archived/helm/basket-api/templates/service.yaml View File

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

+ 0
- 61
deploy/k8s/archived/helm/basket-api/values.yaml View File

@ -1,61 +0,0 @@
replicaCount: 1
clusterName: eshop-aks
pathBase: /basket-api
image:
repository: eshop/basket.api
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
grpcPort: 81
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: ConnectionString
key: basket__ConnectionString
- name: EventBusConnection
key: all__EventBusConnection
- name: ApplicationInsights__InstrumentationKey
key: all__InstrumentationKey
- name: AzureServiceBusEnabled
key: all__UseAzureServiceBus
- name: IdentityUrl
key: urls__IdentityUrl
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:
- name: OrchestratorType
value: 'K8S'
- name: PORT
value: "80"
- name: GRPC_PORT
value: "81"
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80
ingress:
enabled: false

+ 0
- 21
deploy/k8s/archived/helm/basket-data/.helmignore View File

@ -1,21 +0,0 @@
# 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
- 5
deploy/k8s/archived/helm/basket-data/Chart.yaml View File

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

+ 0
- 8
deploy/k8s/archived/helm/basket-data/templates/NOTES.txt View File

@ -1,8 +0,0 @@
eShop Redis for keystore data installed
----------------------------------------
Redis is not directly exposed outside cluster. If need to access it from outside use:
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "basket-data.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
- 32
deploy/k8s/archived/helm/basket-data/templates/_helpers.tpl View File

@ -1,32 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "basket-data.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-data.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-data.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

+ 0
- 43
deploy/k8s/archived/helm/basket-data/templates/deployment.yaml View File

@ -1,43 +0,0 @@
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "basket-data.fullname" . }}
labels:
app: {{ template "basket-data.name" . }}
chart: {{ template "basket-data.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "basket-data.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "basket-data.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 6379
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
- 19
deploy/k8s/archived/helm/basket-data/templates/service.yaml View File

@ -1,19 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.inf.redis.basket.svc }}
labels:
app: {{ template "basket-data.name" . }}
chart: {{ template "basket-data.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 "basket-data.name" . }}
release: {{ .Release.Name }}

+ 0
- 19
deploy/k8s/archived/helm/basket-data/values.yaml View File

@ -1,19 +0,0 @@
replicaCount: 1
image:
repository: redis
tag: 4.0.10
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 6379
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}

+ 0
- 21
deploy/k8s/archived/helm/catalog-api/.helmignore View File

@ -1,21 +0,0 @@
# 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
- 5
deploy/k8s/archived/helm/catalog-api/Chart.yaml View File

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

+ 0
- 9
deploy/k8s/archived/helm/catalog-api/templates/NOTES.txt View File

@ -1,9 +0,0 @@
eShop Catalog 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 "catalog-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
- 32
deploy/k8s/archived/helm/catalog-api/templates/_helpers.tpl View File

@ -1,32 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "catalog-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 "catalog-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 "catalog-api.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

+ 0
- 60
deploy/k8s/archived/helm/catalog-api/templates/_names.tpl View File

@ -1,60 +0,0 @@
{{- 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 -}}
{{- define "protocol" -}}
{{- if .Values.inf.tls.enabled -}}
{{- printf "%s" "https" -}}
{{- else -}}
{{- printf "%s" "http" -}}
{{- end -}}
{{- end -}}

+ 0
- 21
deploy/k8s/archived/helm/catalog-api/templates/configmap.yaml View File

@ -1,21 +0,0 @@
{{- $name := include "catalog-api.fullname" . -}}
{{- $sqlsrv := include "sql-name" . -}}
{{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}}
{{- $protocol := include "protocol" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "cfg-{{ $name }}"
labels:
app: {{ template "catalog-api.name" . }}
chart: {{ template "catalog-api.chart" .}}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
catalog__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.catalog.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
catalog__PicBaseUrl: {{ $protocol }}://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/
catalog__AzureStorageEnabled: "{{ .Values.inf.misc.useAzureStorage }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

+ 0
- 99
deploy/k8s/archived/helm/catalog-api/templates/deployment.yaml View File

@ -1,99 +0,0 @@
{{- $name := include "catalog-api.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "catalog-api.fullname" . }}
labels:
ufo: {{ $cfgname}}
app: {{ template "catalog-api.name" . }}
chart: {{ template "catalog-api.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "catalog-api.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "catalog-api.name" . }}
release: {{ .Release.Name }}
{{ if .Values.inf.mesh.enabled -}}
annotations:
linkerd.io/inject: enabled
{{- end }}
spec:
{{ if .Values.inf.registry -}}
imagePullSecrets:
- name: {{ .Values.inf.registry.secretName }}
{{- end }}
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 }}
env:
- name: PATH_BASE
value: {{ include "pathBase" . }}
- 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
- name: grpc
containerPort: 81
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
- 23
deploy/k8s/archived/helm/catalog-api/templates/service.yaml View File

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

+ 0
- 63
deploy/k8s/archived/helm/catalog-api/values.yaml View File

@ -1,63 +0,0 @@
replicaCount: 1
clusterName: eshop-aks
pathBase: /catalog-api
image:
repository: eshop/catalog.api
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
grpcPort: 81
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: ConnectionString
key: catalog__ConnectionString
- name: PicBaseUrl
key: catalog__PicBaseUrl
- name: AzureStorageEnabled
key: catalog__AzureStorageEnabled
- name: ApplicationInsights__InstrumentationKey
key: all__InstrumentationKey
- name: EventBusConnection
key: all__EventBusConnection
- name: AzureServiceBusEnabled
key: all__UseAzureServiceBus
# 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
- name: OrchestratorType
value: 'K8S'
- name: PORT
value: "80"
- name: GRPC_PORT
value: "81"
probes:
liveness:
path: /liveness
initialDelaySeconds: 10
periodSeconds: 15
port: 80
readiness:
path: /hc
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80

+ 0
- 149
deploy/k8s/archived/helm/deploy-all.ps1 View File

@ -1,149 +0,0 @@
Param(
[parameter(Mandatory=$false)][string]$registry,
[parameter(Mandatory=$false)][string]$dockerUser,
[parameter(Mandatory=$false)][string]$dockerPassword,
[parameter(Mandatory=$false)][string]$externalDns,
[parameter(Mandatory=$false)][string]$appName="eshop",
[parameter(Mandatory=$false)][bool]$deployInfrastructure=$true,
[parameter(Mandatory=$false)][bool]$deployCharts=$true,
[parameter(Mandatory=$false)][bool]$clean=$true,
[parameter(Mandatory=$false)][string]$aksName="",
[parameter(Mandatory=$false)][string]$aksRg="",
[parameter(Mandatory=$false)][string]$imageTag="latest",
[parameter(Mandatory=$false)][bool]$useLocalk8s=$false,
[parameter(Mandatory=$false)][bool]$useMesh=$false,
[parameter(Mandatory=$false)][string][ValidateSet('Always','IfNotPresent','Never', IgnoreCase=$false)]$imagePullPolicy="Always",
[parameter(Mandatory=$false)][string][ValidateSet('prod','staging','none','custom', IgnoreCase=$false)]$sslSupport = "none",
[parameter(Mandatory=$false)][string]$tlsSecretName = "eshop-tls-custom",
[parameter(Mandatory=$false)][string]$chartsToDeploy="*",
[parameter(Mandatory=$false)][string]$ingressMeshAnnotationsFile="ingress_values_linkerd.yaml"
)
function Install-Chart {
Param([string]$chart,[string]$initialOptions, [bool]$customRegistry)
$options=$initialOptions
if ($sslEnabled) {
$options = "$options --set ingress.tls[0].secretName=$tlsSecretName --set ingress.tls[0].hosts={$dns}"
if ($sslSupport -ne "custom") {
$options = "$options --set inf.tls.issuer=$sslIssuer"
}
}
if ($customRegistry) {
$options = "$options --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret"
}
if ($chart -ne "eshop-common" -or $customRegistry) { # eshop-common is ignored when no secret must be deployed
$command = "install $options --name=$appName-$chart $chart"
Write-Host "Helm Command: helm $command" -ForegroundColor Gray
Invoke-Expression 'cmd /c "helm $command"'
}
}
$dns = $externalDns
$sslEnabled=$false
$sslIssuer=""
if ($sslSupport -eq "staging") {
$sslEnabled=$true
$tlsSecretName="eshop-letsencrypt-staging"
$sslIssuer="letsencrypt-staging"
}
elseif ($sslSupport -eq "prod") {
$sslEnabled=$true
$tlsSecretName="eshop-letsencrypt-prod"
$sslIssuer="letsencrypt-prod"
}
elseif ($sslSupport -eq "custom") {
$sslEnabled=$true
}
$ingressValuesFile="ingress_values.yaml"
if ($useLocalk8s -eq $true) {
$ingressValuesFile="ingress_values_dockerk8s.yaml"
$dns="localhost"
}
if ($externalDns -eq "aks") {
if ([string]::IsNullOrEmpty($aksName) -or [string]::IsNullOrEmpty($aksRg)) {
Write-Host "Error: When using -dns aks, MUST set -aksName and -aksRg too." -ForegroundColor Red
exit 1
}
Write-Host "Getting DNS of AKS of AKS $aksName (in resource group $aksRg)..." -ForegroundColor Green
$dns = $(az aks show -n $aksName -g $aksRg --query addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName)
if ([string]::IsNullOrEmpty($dns)) {
Write-Host "Error getting DNS of AKS $aksName (in resource group $aksRg). Please ensure AKS has httpRouting enabled AND Azure CLI is logged & in version 2.0.37 or higher" -ForegroundColor Red
exit 1
}
$dns = $dns -replace '[\"]'
Write-Host "DNS base found is $dns. Will use $appName.$dns for the app!" -ForegroundColor Green
$dns = "$appName.$dns"
}
# Initialization & check commands
if ([string]::IsNullOrEmpty($dns)) {
Write-Host "No DNS specified. Ingress resources will be bound to public ip" -ForegroundColor Yellow
if ($sslEnabled) {
Write-Host "Can't bound SSL to public IP. DNS is mandatory when using TLS" -ForegroundColor Red
exit 1
}
}
if ($useLocalk8s -and $sslEnabled) {
Write-Host "SSL can'be enabled on local K8s." -ForegroundColor Red
exit 1
}
if ($clean) {
Write-Host "Cleaning previous helm releases..." -ForegroundColor Green
helm delete --purge $(helm ls -q eshop)
Write-Host "Previous releases deleted" -ForegroundColor Green
}
$useCustomRegistry=$false
if (-not [string]::IsNullOrEmpty($registry)) {
$useCustomRegistry=$true
if ([string]::IsNullOrEmpty($dockerUser) -or [string]::IsNullOrEmpty($dockerPassword)) {
Write-Host "Error: Must use -dockerUser AND -dockerPassword if specifying custom registry" -ForegroundColor Red
exit 1
}
}
Write-Host "Begin eShopOnContainers installation using Helm" -ForegroundColor Green
$infras = ("sql-data", "nosql-data", "rabbitmq", "keystore-data", "basket-data")
$charts = ("eshop-common", "basket-api","catalog-api", "identity-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web")
$gateways = ("apigwmm", "apigwms", "apigwwm", "apigwws")
if ($deployInfrastructure) {
foreach ($infra in $infras) {
Write-Host "Installing infrastructure: $infra" -ForegroundColor Green
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --name="$appName-$infra" $infra
}
}
else {
Write-Host "eShopOnContainers infrastructure (bbdd, redis, ...) charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
}
if ($deployCharts) {
foreach ($chart in $charts) {
if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) {
Write-Host "Installing: $chart" -ForegroundColor Green
Install-Chart $chart "-f app.yaml --values inf.yaml -f $ingressValuesFile -f $ingressMeshAnnotationsFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.tls.enabled=$sslEnabled --set inf.mesh.enabled=$useMesh --set inf.k8s.local=$useLocalk8s" $useCustomRegistry
}
}
foreach ($chart in $gateways) {
if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) {
Write-Host "Installing Api Gateway Chart: $chart" -ForegroundColor Green
Install-Chart $chart "-f app.yaml -f inf.yaml -f $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --set ingress.hosts={$dns} --set inf.tls.enabled=$sslEnabled" $false
}
}
}
else {
Write-Host "eShopOnContainers non-infrastructure charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
}
Write-Host "helm charts installed." -ForegroundColor Green

+ 0
- 232
deploy/k8s/archived/helm/deploy-all.sh View File

@ -1,232 +0,0 @@
#!/usr/bin/env bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode
set -euo pipefail
usage()
{
cat <<END
deploy.sh: deploys the $app_name application to a Kubernetes cluster using Helm.
Parameters:
--aks-name <AKS cluster name>
The name of the AKS cluster. Required when the registry (using the -r parameter) is set to "aks".
--aks-rg <AKS resource group>
The resource group for the AKS cluster. Required when the registry (using the -r parameter) is set to "aks".
-b | --build-solution
Force a solution build before deployment (default: false).
-d | --dns <dns or ip address> | --dns aks
Specifies the external DNS/ IP address of the Kubernetes cluster.
If 'aks' is set as value, the DNS value is retrieved from the AKS. --aks-name and --aks-rg are needed.
When --use-local-k8s is specified the external DNS is automatically set to localhost.
-h | --help
Displays this help text and exits the script.
--image-build
Build images (default is to not build all images).
--image-push
Upload images to the container registry (default is not pushing to the custom registry)
-n | --app-name <the name of the app>
Specifies the name of the application (default: eshop).
--namespace <namespace name>
Specifies the namespace name to deploy the app. If it doesn't exists it will be created (default: eshop).
-p | --docker-password <docker password>
The Docker password used to logon to the custom registry, supplied using the -r parameter.
-r | --registry <container registry>
Specifies the container registry to use (required), e.g. myregistry.azurecr.io.
--skip-clean
Do not clean the Kubernetes cluster (default is to clean the cluster).
--skip-infrastructure
Do not deploy infrastructure resources (like sql-data, no-sql or redis).
This is useful for production environments where infrastructure is hosted outside the Kubernetes cluster.
-t | --tag <docker image tag>
The tag used for the newly created docker images. Default: latest.
-u | --docker-username <docker username>
The Docker username used to logon to the custom registry, supplied using the -r parameter.
--use-local-k8s
Deploy to a locally installed Kubernetes (default: false).
It is assumed that the Kubernetes cluster has been granted access to the container registry.
If using AKS and ACR see link for more info:
https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks
WARNING! THE SCRIPT WILL COMPLETELY DESTROY ALL DEPLOYMENTS AND SERVICES VISIBLE
FROM THE CURRENT CONFIGURATION CONTEXT AND NAMESPACE.
It is recommended that you check your selected namespace, 'eshop' by default, is already in use.
Every deployment and service done in the namespace will be deleted.
For more information see https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
END
}
app_name='eshop'
aks_name=''
aks_rg=''
build_images=''
clean='yes'
build_solution=''
container_registry=''
docker_password=''
docker_username=''
dns=''
image_tag='latest'
push_images=''
skip_infrastructure=''
use_local_k8s=''
namespace='eshop'
while [[ $# -gt 0 ]]; do
case "$1" in
--aks-name )
aks_name="$2"; shift 2;;
--aks-rg )
aks_rg="$2"; shift 2;;
-b | --build-solution )
build_solution='yes'; shift ;;
-d | --dns )
dns="$2"; shift 2;;
-h | --help )
usage; exit 1 ;;
-n | --app-name )
app_name="$2"; shift 2;;
-p | --docker-password )
docker_password="$2"; shift 2;;
-r | --registry )
container_registry="$2"; shift 2;;
--skip-clean )
clean=''; shift ;;
--image-build )
build_images='yes'; shift ;;
--image-push )
push_images='yes'; shift ;;
--skip-infrastructure )
skip_infrastructure='yes'; shift ;;
-t | --tag )
image_tag="$2"; shift 2;;
-u | --docker-username )
docker_username="$2"; shift 2;;
--use-local-k8s )
use_local_k8s='yes'; shift ;;
--namespace )
namespace="$2"; shift 2;;
*)
echo "Unknown option $1"
usage; exit 2 ;;
esac
done
if [[ $build_solution ]]; then
echo "#################### Building $app_name solution ####################"
dotnet publish -o obj/Docker/publish ../../eShopOnContainers-ServicesAndWebApps.sln
fi
export TAG=$image_tag
if [[ $build_images ]]; then
echo "#################### Building the $app_name Docker images ####################"
docker-compose -p ../.. -f ../../docker-compose.yml build
# Remove temporary images
docker rmi $(docker images -qf "dangling=true")
fi
use_custom_registry=''
if [[ -n $container_registry ]]; then
echo "################ Log into custom registry $container_registry ##################"
use_custom_registry='yes'
if [[ -z $docker_username ]] || [[ -z $docker_password ]]; then
echo "Error: Must use -u (--docker-username) AND -p (--docker-password) if specifying custom registry"
exit 1
fi
docker login -u $docker_username -p $docker_password $container_registry
fi
if [[ $push_images ]]; then
echo "#################### Pushing images to the container registry ####################"
services=(basket.api catalog.api identity.api ordering.api payment.api webmvc webspa webstatus)
if [[ -z "$(docker image ls -q --filter=reference=eshop/$service:$image_tag)" ]]; then
image_tag=linux-$image_tag
fi
for service in "${services[@]}"
do
echo "Pushing image for service $service..."
docker tag "eshop/$service:$image_tag" "$container_registry/$service:$image_tag"
docker push "$container_registry/$service:$image_tag"
done
fi
ingress_values_file="ingress_values.yaml"
if [[ $use_local_k8s ]]; then
ingress_values_file="ingress_values_dockerk8s.yaml"
dns="localhost"
fi
if [[ $dns == "aks" ]]; then
echo "#################### Begin AKS discovery based on the --dns aks setting. ####################"
if [[ -z $aks_name ]] || [[ -z $aks_rg ]]; then
echo "Error: When using -dns aks, MUST set -aksName and -aksRg too."
echo ''
usage
exit 1
fi
echo "Getting AKS cluster $aks_name AKS (in resource group $aks_rg)"
# JMESPath queries are case sensitive and httpapplicationrouting can be lowercase sometimes
jmespath_dnsqueries=(\
addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName \
addonProfiles.httpapplicationrouting.config.HTTPApplicationRoutingZoneName \
)
for q in "${jmespath_dnsqueries[@]}"
do
dns="$(az aks show -n $aks_name -g $aks_rg --query $q -o tsv)"
if [[ -n $dns ]]; then break; fi
done
if [[ -z $dns ]]; then
echo "Error: when getting DNS of AKS $aks_name (in resource group $aks_rg). Please ensure AKS has httpRouting enabled AND Azure CLI is logged in and is of version 2.0.37 or higher."
exit 1
fi
echo "DNS base found is $dns. Will use $aks_name.$dns for the app!"
dns="$aks_name.$dns"
fi
# Initialization & check commands
if [[ -z $dns ]]; then
echo "No DNS specified. Ingress resources will be bound to public IP."
fi
if [[ $clean ]]; then
echo "Cleaning previous helm releases..."
if [[ -z $(helm ls -q --namespace $namespace) ]]; then
echo "No previous releases found"
else
helm delete --purge $(helm ls -q --namespace $namespace)
echo "Previous releases deleted"
waitsecs=10; while [ $waitsecs -gt 0 ]; do echo -ne "$waitsecs\033[0K\r"; sleep 1; : $((waitsecs--)); done
fi
fi
echo "#################### Begin $app_name installation using Helm ####################"
infras=(sql-data nosql-data rabbitmq keystore-data basket-data)
charts=(eshop-common apigwms apigwws basket-api catalog-api identity-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web)
if [[ !$skip_infrastructure ]]; then
for infra in "${infras[@]}"
do
echo "Installing infrastructure: $infra"
helm install --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --name="$app_name-$infra" $infra
done
fi
for chart in "${charts[@]}"
do
echo "Installing: $chart"
if [[ $use_custom_registry ]]; then
helm install --namespace $namespace --set "ingress.hosts={$dns}" --set inf.registry.server=$container_registry --set inf.registry.login=$docker_username --set inf.registry.pwd=$docker_password --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always --name="$app_name-$chart" $chart
elif [[ $chart != "eshop-common" ]]; then # eshop-common is ignored when no secret must be deployed
helm install --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always --name="$app_name-$chart" $chart
fi
done
echo "FINISHED: Helm charts installed."

+ 0
- 21
deploy/k8s/archived/helm/eshop-common/.helmignore View File

@ -1,21 +0,0 @@
# 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
- 5
deploy/k8s/archived/helm/eshop-common/Chart.yaml View File

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

+ 0
- 7
deploy/k8s/archived/helm/eshop-common/templates/NOTES.txt View File

@ -1,7 +0,0 @@
Common eShop resources installed:
{{- if .Values.inf.registry -}}
* Docker registry secret ({{ .Values.inf.registry.secretName }})
{{- end -}}
+++ Done +++

+ 0
- 32
deploy/k8s/archived/helm/eshop-common/templates/_helpers.tpl View File

@ -1,32 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "eshop-common.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 "eshop-common.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 "eshop-common.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

+ 0
- 3
deploy/k8s/archived/helm/eshop-common/templates/_names.tpl View File

@ -1,3 +0,0 @@
{{- define "imagePullSecret" }}
{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.inf.registry.server (printf "%s:%s" .Values.inf.registry.login .Values.inf.registry.pwd | b64enc) | b64enc }}
{{- end }}

+ 0
- 9
deploy/k8s/archived/helm/eshop-common/templates/secret.yaml View File

@ -1,9 +0,0 @@
{{- if .Values.inf.registry -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.inf.registry.secretName }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ template "imagePullSecret" . }}
{{- end -}}

+ 0
- 0
deploy/k8s/archived/helm/eshop-common/values.yaml View File


+ 0
- 21
deploy/k8s/archived/helm/identity-api/.helmignore View File

@ -1,21 +0,0 @@
# 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
- 5
deploy/k8s/archived/helm/identity-api/Chart.yaml View File

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

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

Loading…
Cancel
Save