From da0e437acd7e060c0c775c75aa8ba13e10e132ea Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 4 Feb 2022 16:41:20 +0300 Subject: [PATCH 01/13] added multi-stage dockerfiles of business services --- .../Dockerfile | 51 +++++++++++++++++++ .../Dockerfile | 51 +++++++++++++++++++ .../Dockerfile | 51 +++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile create mode 100644 services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile create mode 100644 services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..fba2a67e --- /dev/null +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile @@ -0,0 +1,51 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host" +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.CatalogService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..32da73fa --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/Dockerfile @@ -0,0 +1,51 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host" +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.OrderingService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..87dddaa6 --- /dev/null +++ b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/Dockerfile @@ -0,0 +1,51 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host" +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.PaymentService.HttpApi.Host.dll"] \ No newline at end of file From 410f15e233dddcef1d31d4807fef1df2c3b198a4 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 4 Feb 2022 16:41:26 +0300 Subject: [PATCH 02/13] updated build scripts --- build/build-images-locally.ps1 | 35 +++++++++++++++++++++++++++------- build/build-images.ps1 | 32 ++++++++++++++++++++++++------- 2 files changed, 53 insertions(+), 14 deletions(-) diff --git a/build/build-images-locally.ps1 b/build/build-images-locally.ps1 index 7fc395cf..0773c751 100644 --- a/build/build-images-locally.ps1 +++ b/build/build-images-locally.ps1 @@ -11,9 +11,12 @@ $webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnA $identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" $administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" +$catalogServiceFolder = Join-Path $slnFolder "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host" +$paymentServiceFolder = Join-Path $slnFolder "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host" +$orderingServiceFolder = Join-Path $slnFolder "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host" ### Angular WEB App(WWW) -Write-Host "*** BUILDING WEB (WWW) 1/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB (WWW) 1/10 ****************" -ForegroundColor Green Set-Location $webAppFolder yarn # ng build --prod @@ -21,41 +24,59 @@ npm run build:prod docker build -f Dockerfile.local -t eshoponabp/app-web:$version . ### AUTH-SERVER -Write-Host "*** BUILDING AUTH-SERVER 2/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING AUTH-SERVER 2/10 ****************" -ForegroundColor Green Set-Location $authserverFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/app-authserver:$version . ### PUBLIC-WEB -Write-Host "*** BUILDING WEB-PUBLIC 3/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-PUBLIC 3/10 ****************" -ForegroundColor Green Set-Location $publicWebFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/app-publicweb:$version . ### WEB-GATEWAY -Write-Host "*** BUILDING WEB-GATEWAY 4/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-GATEWAY 4/10 ****************" -ForegroundColor Green Set-Location $webGatewayFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/gateway-web:$version . ### PUBLICWEB-GATEWAY -Write-Host "*** BUILDING WEB-PUBLIC-GATEWAY 5/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-PUBLIC-GATEWAY 5/10 ****************" -ForegroundColor Green Set-Location $webPublicGatewayFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/gateway-web-public:$version . ### IDENTITY-SERVICE -Write-Host "*** BUILDING IDENTITY-SERVICE 6/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING IDENTITY-SERVICE 6/10 ****************" -ForegroundColor Green Set-Location $identityServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-identity:$version . ### ADMINISTRATION-SERVICE -Write-Host "*** BUILDING ADMINISTRATION-SERVICE 7/7 ****************" -ForegroundColor Green +Write-Host "*** BUILDING ADMINISTRATION-SERVICE 7/10 ****************" -ForegroundColor Green Set-Location $administrationServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-administration:$version . +### CATALOG-SERVICE +Write-Host "**************** BUILDING CATALOG-SERVICE 8/10 ****************" -ForegroundColor Green +Set-Location $catalogServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-catalog:$version . + +### PAYMENT-SERVICE +Write-Host "**************** BUILDING PAYMENT-SERVICE 9/10 ****************" -ForegroundColor Green +Set-Location $paymentServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-payment:$version . + +### ORDERING-SERVICE +Write-Host "**************** BUILDING ORDERING-SERVICE 10/10 ****************" -ForegroundColor Green +Set-Location $orderingServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-ordering:$version . + ### ALL COMPLETED Write-Host "ALL COMPLETED" -ForegroundColor Green Set-Location $currentFolder \ No newline at end of file diff --git a/build/build-images.ps1 b/build/build-images.ps1 index 9e3999a7..ed391c57 100644 --- a/build/build-images.ps1 +++ b/build/build-images.ps1 @@ -11,48 +11,66 @@ $webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnA $identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" $administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" +$catalogServiceFolder = Join-Path $slnFolder "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host" +$paymentServiceFolder = Join-Path $slnFolder "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host" +$orderingServiceFolder = Join-Path $slnFolder "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host" Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow ### Angular WEB App -Write-Host "*** BUILDING ANGULAR WEB APPLICATION 1/7 ***" -ForegroundColor Green +Write-Host "*** BUILDING ANGULAR WEB APPLICATION 1/10 ***" -ForegroundColor Green Set-Location $webAppFolder docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . ### AUTH-SERVER -Write-Host "**************** BUILDING AUTH-SERVER 2/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING AUTH-SERVER 2/10 ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . ### PUBLIC-WEB -Write-Host "**************** BUILDING WEB-PUBLIC 3/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-PUBLIC 3/10 ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow ### WEB-GATEWAY -Write-Host "**************** BUILDING WEB-GATEWAY 4/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-GATEWAY 4/10 ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version . ### PUBLICWEB-GATEWAY -Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY 5/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY 5/10 ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-public:$version . Write-Host "===== BUILDING MICROSERVICES =====" -ForegroundColor Yellow ### IDENTITY-SERVICE -Write-Host "**************** BUILDING IDENTITY-SERVICE 6/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING IDENTITY-SERVICE 6/10 ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . ### ADMINISTRATION-SERVICE -Write-Host "**************** BUILDING ADMINISTRATION-SERVICE 7/7 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING ADMINISTRATION-SERVICE 7/10 ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . +### CATALOG-SERVICE +Write-Host "**************** BUILDING CATALOG-SERVICE 8/10 ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$catalogServiceFolder/Dockerfile" -t eshoponabp/service-catalog:$version . + +### PAYMENT-SERVICE +Write-Host "**************** BUILDING PAYMENT-SERVICE 9/10 ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$paymentServiceFolder/Dockerfile" -t eshoponabp/service-payment:$version . + +### ORDERING-SERVICE +Write-Host "**************** BUILDING ORDERING-SERVICE 10/10 ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$orderingServiceFolder/Dockerfile" -t eshoponabp/service-ordering:$version . + ### ALL COMPLETED Write-Host "ALL COMPLETED" -ForegroundColor Green Set-Location $currentFolder \ No newline at end of file From c8c893adc800e09d66f5059581df755062d63e5d Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 7 Feb 2022 13:36:11 +0300 Subject: [PATCH 03/13] added basket dockerfile and build images --- build/build-images-locally.ps1 | 34 ++++++++----- build/build-images.ps1 | 33 +++++++----- .../Dockerfile | 51 +++++++++++++++++++ 3 files changed, 94 insertions(+), 24 deletions(-) create mode 100644 services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile diff --git a/build/build-images-locally.ps1 b/build/build-images-locally.ps1 index 0773c751..59030fb2 100644 --- a/build/build-images-locally.ps1 +++ b/build/build-images-locally.ps1 @@ -2,21 +2,25 @@ param ($version='latest') $currentFolder = $PSScriptRoot $slnFolder = Join-Path $currentFolder "../" +# Apps $webAppFolder = Join-Path $slnFolder "apps/angular" $authserverFolder = Join-Path $slnFolder "apps/auth-server/src/EShopOnAbp.AuthServer" $publicWebFolder = Join-Path $slnFolder "apps/public-web/src/EShopOnAbp.PublicWeb" - +# Gateways $webGatewayFolder = Join-Path $slnFolder "gateways/web/src/EShopOnAbp.WebGateway" $webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnAbp.WebPublicGateway" - +# Microservices $identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" $administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" +$basketServiceFolder = Join-Path $slnFolder "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host" $catalogServiceFolder = Join-Path $slnFolder "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host" $paymentServiceFolder = Join-Path $slnFolder "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host" $orderingServiceFolder = Join-Path $slnFolder "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host" +$total = 11 + ### Angular WEB App(WWW) -Write-Host "*** BUILDING WEB (WWW) 1/10 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB (WWW) 1/$total ****************" -ForegroundColor Green Set-Location $webAppFolder yarn # ng build --prod @@ -24,55 +28,61 @@ npm run build:prod docker build -f Dockerfile.local -t eshoponabp/app-web:$version . ### AUTH-SERVER -Write-Host "*** BUILDING AUTH-SERVER 2/10 ****************" -ForegroundColor Green +Write-Host "*** BUILDING AUTH-SERVER 2/$total ****************" -ForegroundColor Green Set-Location $authserverFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/app-authserver:$version . ### PUBLIC-WEB -Write-Host "*** BUILDING WEB-PUBLIC 3/10 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-PUBLIC 3/$total ****************" -ForegroundColor Green Set-Location $publicWebFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/app-publicweb:$version . ### WEB-GATEWAY -Write-Host "*** BUILDING WEB-GATEWAY 4/10 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-GATEWAY 4/$total ****************" -ForegroundColor Green Set-Location $webGatewayFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/gateway-web:$version . ### PUBLICWEB-GATEWAY -Write-Host "*** BUILDING WEB-PUBLIC-GATEWAY 5/10 ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-PUBLIC-GATEWAY 5/$total ****************" -ForegroundColor Green Set-Location $webPublicGatewayFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/gateway-web-public:$version . ### IDENTITY-SERVICE -Write-Host "*** BUILDING IDENTITY-SERVICE 6/10 ****************" -ForegroundColor Green +Write-Host "*** BUILDING IDENTITY-SERVICE 6/$total ****************" -ForegroundColor Green Set-Location $identityServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-identity:$version . ### ADMINISTRATION-SERVICE -Write-Host "*** BUILDING ADMINISTRATION-SERVICE 7/10 ****************" -ForegroundColor Green +Write-Host "*** BUILDING ADMINISTRATION-SERVICE 7/$total ****************" -ForegroundColor Green Set-Location $administrationServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-administration:$version . +### BASKET-SERVICE +Write-Host "**************** BUILDING BASKET-SERVICE 8/10 ****************" -ForegroundColor Green +Set-Location $basketServiceFolder +dotnet publish -c Release +docker build -f Dockerfile.local -t eshoponabp/service-basket:$version . + ### CATALOG-SERVICE -Write-Host "**************** BUILDING CATALOG-SERVICE 8/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING CATALOG-SERVICE 9/$total ****************" -ForegroundColor Green Set-Location $catalogServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-catalog:$version . ### PAYMENT-SERVICE -Write-Host "**************** BUILDING PAYMENT-SERVICE 9/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING PAYMENT-SERVICE 10/$total ****************" -ForegroundColor Green Set-Location $paymentServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-payment:$version . ### ORDERING-SERVICE -Write-Host "**************** BUILDING ORDERING-SERVICE 10/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING ORDERING-SERVICE 11/$total ****************" -ForegroundColor Green Set-Location $orderingServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-ordering:$version . diff --git a/build/build-images.ps1 b/build/build-images.ps1 index ed391c57..c781b5d0 100644 --- a/build/build-images.ps1 +++ b/build/build-images.ps1 @@ -2,72 +2,81 @@ param ($version='1.0') $currentFolder = $PSScriptRoot $slnFolder = Join-Path $currentFolder "../" +# Apps $webAppFolder = Join-Path $slnFolder "apps/angular" $authserverFolder = Join-Path $slnFolder "apps/auth-server/src/EShopOnAbp.AuthServer" $publicWebFolder = Join-Path $slnFolder "apps/public-web/src/EShopOnAbp.PublicWeb" - +# Gateways $webGatewayFolder = Join-Path $slnFolder "gateways/web/src/EShopOnAbp.WebGateway" $webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnAbp.WebPublicGateway" - +# Microservices $identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" $administrationServiceFolder = Join-Path $slnFolder "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host" +$basketServiceFolder = Join-Path $slnFolder "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host" $catalogServiceFolder = Join-Path $slnFolder "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host" $paymentServiceFolder = Join-Path $slnFolder "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host" $orderingServiceFolder = Join-Path $slnFolder "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host" +$total = 11 + Write-Host "===== BUILDING APPLICATIONS =====" -ForegroundColor Yellow ### Angular WEB App -Write-Host "*** BUILDING ANGULAR WEB APPLICATION 1/10 ***" -ForegroundColor Green +Write-Host "*** BUILDING ANGULAR WEB APPLICATION 1/$total ***" -ForegroundColor Green Set-Location $webAppFolder docker build -f "$webAppFolder/Dockerfile" -t eshoponabp/app-web:$version . ### AUTH-SERVER -Write-Host "**************** BUILDING AUTH-SERVER 2/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING AUTH-SERVER 2/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$authserverFolder/Dockerfile" -t eshoponabp/app-authserver:$version . ### PUBLIC-WEB -Write-Host "**************** BUILDING WEB-PUBLIC 3/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-PUBLIC 3/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$publicWebFolder/Dockerfile" -t eshoponabp/app-publicweb:$version . Write-Host "===== BUILDING GATEWAYS =====" -ForegroundColor Yellow ### WEB-GATEWAY -Write-Host "**************** BUILDING WEB-GATEWAY 4/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-GATEWAY 4/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$webGatewayFolder/Dockerfile" -t eshoponabp/gateway-web:$version . ### PUBLICWEB-GATEWAY -Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY 5/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING WEB-PUBLIC-GATEWAY 5/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$webPublicGatewayFolder/Dockerfile" -t eshoponabp/gateway-web-public:$version . Write-Host "===== BUILDING MICROSERVICES =====" -ForegroundColor Yellow ### IDENTITY-SERVICE -Write-Host "**************** BUILDING IDENTITY-SERVICE 6/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING IDENTITY-SERVICE 6/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$identityServiceFolder/Dockerfile" -t eshoponabp/service-identity:$version . ### ADMINISTRATION-SERVICE -Write-Host "**************** BUILDING ADMINISTRATION-SERVICE 7/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING ADMINISTRATION-SERVICE 7/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$administrationServiceFolder/Dockerfile" -t eshoponabp/service-administration:$version . +### BASKET-SERVICE +Write-Host "**************** BUILDING BASKET-SERVICE 8/$total ****************" -ForegroundColor Green +Set-Location $slnFolder +docker build -f "$basketServiceFolder/Dockerfile" -t eshoponabp/service-basket:$version . + ### CATALOG-SERVICE -Write-Host "**************** BUILDING CATALOG-SERVICE 8/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING CATALOG-SERVICE 9/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$catalogServiceFolder/Dockerfile" -t eshoponabp/service-catalog:$version . ### PAYMENT-SERVICE -Write-Host "**************** BUILDING PAYMENT-SERVICE 9/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING PAYMENT-SERVICE 10/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$paymentServiceFolder/Dockerfile" -t eshoponabp/service-payment:$version . ### ORDERING-SERVICE -Write-Host "**************** BUILDING ORDERING-SERVICE 10/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING ORDERING-SERVICE 11/$total ****************" -ForegroundColor Green Set-Location $slnFolder docker build -f "$orderingServiceFolder/Dockerfile" -t eshoponabp/service-ordering:$version . diff --git a/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile b/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile new file mode 100644 index 00000000..9279ab5a --- /dev/null +++ b/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/Dockerfile @@ -0,0 +1,51 @@ +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src + +# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles +# to take advantage of Docker's build cache, to speed up local container builds +COPY "EShopOnAbp.sln" "EShopOnAbp.sln" + +# Applications +COPY "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" "apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj" +COPY "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" "apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj" + +# Shared +COPY "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" "shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" "shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" "shared/EShopOnAbp.Shared.Hosting.Gateways/EShopOnAbp.Shared.Hosting.Gateways.csproj" +COPY "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" "shared/EShopOnAbp.Shared.Hosting.Microservices/EShopOnAbp.Shared.Hosting.Microservices.csproj" +COPY "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" "shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj" + +# Microservices +COPY "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" "services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj" +COPY "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj" +COPY *"services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" "services/basket/src/EShopOnAbp.BasketService.HttpApi.Host/EShopOnAbp.BasketService.HttpApi.Host.csproj" +COPY *"services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" "services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj" +COPY *"services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" "services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj" +COPY *"services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" "services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj" + +# Gateways +COPY "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" "gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj" +COPY "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" "gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj" + +COPY "NuGet.Config" "NuGet.Config" + +RUN dotnet restore "EShopOnAbp.sln" +COPY . . + +WORKDIR "/src/services/basket/src/EShopOnAbp.BasketService.HttpApi.Host" +RUN dotnet publish -c Release -o /app +# Should be used after .net6 is out of preview for better performance +# RUN dotnet publish --no-restore -c Release -o /app + +FROM build AS publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "EShopOnAbp.BasketService.HttpApi.Host.dll"] \ No newline at end of file From e36e99fdba7d537e83e8e109dd97c40cc2c2c7e9 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 7 Feb 2022 13:36:27 +0300 Subject: [PATCH 04/13] added basket chart --- etc/k8s/eshoponabp/charts/basket/Chart.yaml | 6 +++ .../basket/templates/basket-deployment.yaml | 51 +++++++++++++++++++ .../basket/templates/basket-ingress.yaml | 27 ++++++++++ .../basket/templates/basket-service.yaml | 14 +++++ etc/k8s/eshoponabp/charts/basket/values.yaml | 27 ++++++++++ etc/k8s/eshoponabp/values.yaml | 22 ++++++++ 6 files changed, 147 insertions(+) create mode 100644 etc/k8s/eshoponabp/charts/basket/Chart.yaml create mode 100644 etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml create mode 100644 etc/k8s/eshoponabp/charts/basket/templates/basket-ingress.yaml create mode 100644 etc/k8s/eshoponabp/charts/basket/templates/basket-service.yaml create mode 100644 etc/k8s/eshoponabp/charts/basket/values.yaml diff --git a/etc/k8s/eshoponabp/charts/basket/Chart.yaml b/etc/k8s/eshoponabp/charts/basket/Chart.yaml new file mode 100644 index 00000000..ca500582 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: basket +appVersion: "1.0" +description: eShopOnAbp Basket Microservice +version: 1.0.0 +type: application \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml b/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml new file mode 100644 index 00000000..b057b7cc --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.swaggerClientSecret }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/basket/templates/basket-ingress.yaml b/etc/k8s/eshoponabp/charts/basket/templates/basket-ingress.yaml new file mode 100644 index 00000000..e843265f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/templates/basket-ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +spec: + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} + rules: + - host: "{{ .Values.ingress.host }}" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }} + port: + number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/basket/templates/basket-service.yaml b/etc/k8s/eshoponabp/charts/basket/templates/basket-service.yaml new file mode 100644 index 00000000..ee157c01 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/templates/basket-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/basket/values.yaml b/etc/k8s/eshoponabp/charts/basket/values.yaml new file mode 100644 index 00000000..c154541c --- /dev/null +++ b/etc/k8s/eshoponabp/charts/basket/values.yaml @@ -0,0 +1,27 @@ +config: + selfUrl: # https://eshop-st-basket + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-public + connectionStrings: + administrationService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: "WebGateway_Swagger" + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: eshop-st-basket + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-basket + tag: latest + pullPolicy: IfNotPresent + +env: {} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 1cbd9878..77c4d2c0 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -166,6 +166,28 @@ gateway-web-public: host: eshop-st-order port: 80 +# basket-service sub-chart override +basket: + config: + selfUrl: https://eshop-st-basket + corsOrigins: https://eshop-st-gateway-web, https://eshop-st-gateway-web-public, https://eshop-st-public-web + connectionStrings: + administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: "WebGateway_Swagger" + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + ingress: + host: eshop-st-basket + image: + repository: "eshoponabp/service-basket" + tag: latest + # Default values for eshoponabp. # This is a YAML-formatted file. From 18ddd8fb69392ed9eaff1e3abb2aa7fb0ea44f38 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Tue, 8 Feb 2022 23:27:48 +0300 Subject: [PATCH 05/13] added catalog service --- etc/k8s/eshoponabp/charts/catalog/Chart.yaml | 6 ++ .../catalog/templates/catalog-deployment.yaml | 64 +++++++++++++++++++ .../catalog/templates/catalog-ingress.yaml | 27 ++++++++ .../catalog/templates/catalog-service.yaml | 18 ++++++ etc/k8s/eshoponabp/charts/catalog/values.yaml | 35 ++++++++++ etc/k8s/eshoponabp/values.yaml | 31 ++++++++- 6 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 etc/k8s/eshoponabp/charts/catalog/Chart.yaml create mode 100644 etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml create mode 100644 etc/k8s/eshoponabp/charts/catalog/templates/catalog-ingress.yaml create mode 100644 etc/k8s/eshoponabp/charts/catalog/templates/catalog-service.yaml create mode 100644 etc/k8s/eshoponabp/charts/catalog/values.yaml diff --git a/etc/k8s/eshoponabp/charts/catalog/Chart.yaml b/etc/k8s/eshoponabp/charts/catalog/Chart.yaml new file mode 100644 index 00000000..e8109a51 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: catalog +appVersion: "1.0" +description: eShopOnAbp Catalog Microservice +version: 1.0.0 +type: application \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml new file mode 100644 index 00000000..937a3593 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml @@ -0,0 +1,64 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + - name: grpc + containerPort: 81 + protocol: TCP + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__CatalogService" + value: {{ .Values.config.connectionStrings.catalogService }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.swaggerClientSecret }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + - name: "Kestrel__Endpoints__Http__Url" + value: "{{ .Values.config.kestrel.httpUrl }}" + - name: "Kestrel__Endpoints__Http__Protocols" + value: "{{ .Values.config.kestrel.httpProtocols }}" + - name: "Kestrel__Endpoints__gRPC__Url" + value: "{{ .Values.config.kestrel.grpcUrl }}" + - name: "Kestrel__Endpoints__gRPC__Protocols" + value: "{{ .Values.config.kestrel.grpcProtocols }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/catalog/templates/catalog-ingress.yaml b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-ingress.yaml new file mode 100644 index 00000000..e843265f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +spec: + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} + rules: + - host: "{{ .Values.ingress.host }}" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }} + port: + number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/catalog/templates/catalog-service.yaml b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-service.yaml new file mode 100644 index 00000000..278771cd --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + - port: {{ .Values.config.grpcPort }} + targetPort: grpc + protocol: TCP + name: grpc + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/catalog/values.yaml b/etc/k8s/eshoponabp/charts/catalog/values.yaml new file mode 100644 index 00000000..d45c8b9e --- /dev/null +++ b/etc/k8s/eshoponabp/charts/catalog/values.yaml @@ -0,0 +1,35 @@ +config: + selfUrl: # https://eshop-st-catalog + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-public,https://eshop-st-web + connectionStrings: + catalogService: # + administrationService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + grpcPort: 81 + kestrel: + httpUrl: # + httpProtocols: Http1AndHttp2 + grpcUrl: # + grpcProtocols: Http2 + + +ingress: + host: eshop-st-catalog + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-catalog + tag: latest + pullPolicy: IfNotPresent + +env: {} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 77c4d2c0..3ea5fc64 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -170,13 +170,13 @@ gateway-web-public: basket: config: selfUrl: https://eshop-st-basket - corsOrigins: https://eshop-st-gateway-web, https://eshop-st-gateway-web-public, https://eshop-st-public-web + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-public-web connectionStrings: administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" - swaggerClientId: "WebGateway_Swagger" + swaggerClientId: WebGateway_Swagger swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis @@ -188,6 +188,33 @@ basket: repository: "eshoponabp/service-basket" tag: latest +# basket-service sub-chart override +catalog: + config: + selfUrl: https://eshop-st-catalog + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-public-web,https://eshop-st-web + connectionStrings: + catalogService: "mongodb://mongodb:27017/EShopOnAbp_Catalog" + administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + kestrel: + httpUrl: http://eshop-st-catalog + httpProtocols: Http1AndHttp2 + grpcUrl: http://eshop-st-catalog + grpcProtocols: Http2 + ingress: + host: eshop-st-catalog + image: + repository: "eshoponabp/service-catalog" + tag: latest # Default values for eshoponabp. # This is a YAML-formatted file. From 56c7d32e2bc903032320ab537be98fed4719ebdc Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 9 Feb 2022 02:36:02 +0300 Subject: [PATCH 06/13] updated catalog and basket service values --- .../charts/basket/templates/basket-deployment.yaml | 6 +++++- etc/k8s/eshoponabp/charts/basket/values.yaml | 3 +++ .../charts/catalog/templates/catalog-deployment.yaml | 4 ++-- etc/k8s/eshoponabp/values.yaml | 12 ++++++++---- .../Dockerfile.local | 8 ++++---- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml b/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml index b057b7cc..8105cacf 100644 --- a/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/basket/templates/basket-deployment.yaml @@ -44,7 +44,11 @@ spec: - name: "AuthServer__SwaggerClientSecret" value: "{{ .Values.config.swaggerClientSecret }}" - name: "StringEncryption__DefaultPassPhrase" - value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + - name: "RemoteServices__Catalog__BaseUrl" + value: "{{ .Values.config.remoteServices.catalogBaseUrl }}" + - name: "RemoteServices__Catalog__GrpcUrl" + value: "{{ .Values.config.remoteServices.catalogGrpcUrl }}" {{- if .Values.env }} {{ toYaml .Values.env | indent 8 }} {{- end }} diff --git a/etc/k8s/eshoponabp/charts/basket/values.yaml b/etc/k8s/eshoponabp/charts/basket/values.yaml index c154541c..5571e666 100644 --- a/etc/k8s/eshoponabp/charts/basket/values.yaml +++ b/etc/k8s/eshoponabp/charts/basket/values.yaml @@ -13,6 +13,9 @@ config: rabbitmqHost: es-st-rabbitmq elasticsearchHost: es-st-elasticsearch stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + remoteServices: + catalogBaseUrl: # + catalogGrpcUrl: # ingress: host: eshop-st-basket diff --git a/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml index 937a3593..17aef76c 100644 --- a/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/catalog/templates/catalog-deployment.yaml @@ -45,9 +45,9 @@ spec: - name: "AuthServer__RequireHttpsMetadata" value: "{{ .Values.config.authServer.requireHttpsMetadata }}" - name: "AuthServer__SwaggerClientId" - value: "{{ .Values.config.swaggerClientId }}" + value: "{{ .Values.config.authServer.swaggerClientId }}" - name: "AuthServer__SwaggerClientSecret" - value: "{{ .Values.config.swaggerClientSecret }}" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "StringEncryption__DefaultPassPhrase" value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" - name: "Kestrel__Endpoints__Http__Url" diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 3ea5fc64..13e44171 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -8,6 +8,7 @@ authserver: administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" identityService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Identity;User ID=postgres;password=myPassw0rd;Pooling=false" dotnetEnv: Staging + globalizationInvariant: 0 #https://docs.microsoft.com/en-us/dotnet/core/runtime-config/globalization redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq elasticsearchHost: es-st-elasticsearch @@ -182,19 +183,22 @@ basket: redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq elasticsearchHost: es-st-elasticsearch + remoteServices: + catalogBaseUrl: http://eshop-st-catalog + catalogGrpcUrl: http://eshop-st-catalog ingress: host: eshop-st-basket image: repository: "eshoponabp/service-basket" tag: latest -# basket-service sub-chart override +# catalog-service sub-chart override catalog: config: selfUrl: https://eshop-st-catalog corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-public-web,https://eshop-st-web connectionStrings: - catalogService: "mongodb://mongodb:27017/EShopOnAbp_Catalog" + catalogService: "mongodb://es-st-mongodb/EShopOnAbp_Catalog" administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" authServer: authority: http://eshop-st-authserver @@ -206,9 +210,9 @@ catalog: rabbitmqHost: es-st-rabbitmq elasticsearchHost: es-st-elasticsearch kestrel: - httpUrl: http://eshop-st-catalog + httpUrl: http://eshop-st-catalog:80 httpProtocols: Http1AndHttp2 - grpcUrl: http://eshop-st-catalog + grpcUrl: http://eshop-st-catalog:81 grpcProtocols: Http2 ingress: host: eshop-st-catalog diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local index 28dcb67f..1811b197 100644 --- a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/Dockerfile.local @@ -1,4 +1,4 @@ - FROM mcr.microsoft.com/dotnet/aspnet:6.0 - COPY bin/Release/net6.0/publish/ app/ - WORKDIR /app - ENTRYPOINT ["dotnet", "EShopOnAbp.CatalogService.HttpApi.Host.dll"] \ No newline at end of file +FROM mcr.microsoft.com/dotnet/aspnet:6.0 +COPY bin/Release/net6.0/publish/ app/ +WORKDIR /app +ENTRYPOINT ["dotnet", "EShopOnAbp.CatalogService.HttpApi.Host.dll"] \ No newline at end of file From a39c09f706ce0495233675c56fd431a12758ed87 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 9 Feb 2022 02:42:03 +0300 Subject: [PATCH 07/13] added ordering helm chart --- etc/k8s/eshoponabp/charts/ordering/Chart.yaml | 6 +++ .../templates/ordering-deployment.yaml | 53 +++++++++++++++++++ .../ordering/templates/ordering-ingress.yaml | 27 ++++++++++ .../ordering/templates/ordering-service.yaml | 14 +++++ .../eshoponabp/charts/ordering/values.yaml | 28 ++++++++++ etc/k8s/eshoponabp/values.yaml | 24 +++++++++ 6 files changed, 152 insertions(+) create mode 100644 etc/k8s/eshoponabp/charts/ordering/Chart.yaml create mode 100644 etc/k8s/eshoponabp/charts/ordering/templates/ordering-deployment.yaml create mode 100644 etc/k8s/eshoponabp/charts/ordering/templates/ordering-ingress.yaml create mode 100644 etc/k8s/eshoponabp/charts/ordering/templates/ordering-service.yaml create mode 100644 etc/k8s/eshoponabp/charts/ordering/values.yaml diff --git a/etc/k8s/eshoponabp/charts/ordering/Chart.yaml b/etc/k8s/eshoponabp/charts/ordering/Chart.yaml new file mode 100644 index 00000000..08460269 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: ordering +appVersion: "1.0" +description: eShopOnAbp Ordering Microservice +version: 1.0.0 +type: application \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/ordering/templates/ordering-deployment.yaml b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-deployment.yaml new file mode 100644 index 00000000..78bcb82e --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__OrderingService" + value: {{ .Values.config.connectionStrings.orderingService }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/ordering/templates/ordering-ingress.yaml b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-ingress.yaml new file mode 100644 index 00000000..e843265f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +spec: + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} + rules: + - host: "{{ .Values.ingress.host }}" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }} + port: + number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/ordering/templates/ordering-service.yaml b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-service.yaml new file mode 100644 index 00000000..ee157c01 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/templates/ordering-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/ordering/values.yaml b/etc/k8s/eshoponabp/charts/ordering/values.yaml new file mode 100644 index 00000000..70949147 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/ordering/values.yaml @@ -0,0 +1,28 @@ +config: + selfUrl: # https://eshop-st-ordering + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web + connectionStrings: + orderingService: # + administrationService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: eshop-st-ordering + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-ordering + tag: latest + pullPolicy: IfNotPresent + +env: {} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 13e44171..f5eb4b19 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -220,6 +220,30 @@ catalog: repository: "eshoponabp/service-catalog" tag: latest +# ordering-service sub-chart override +catalog: + config: + selfUrl: https://eshop-st-ordering + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public + connectionStrings: + orderingService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Ordering;User ID=postgres;password=myPassw0rd; + administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + ingress: + host: eshop-st-ordering + image: + repository: "eshoponabp/service-ordering" + tag: latest + + # Default values for eshoponabp. # This is a YAML-formatted file. # Declare variables to be passed into your templates. From 32294da577c77478ff1d4d83e174c97f0dbf0093 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 9 Feb 2022 02:47:08 +0300 Subject: [PATCH 08/13] added payment helm chart --- etc/k8s/eshoponabp/charts/payment/Chart.yaml | 6 +++ .../payment/templates/payment-deployment.yaml | 53 +++++++++++++++++++ .../payment/templates/payment-ingress.yaml | 27 ++++++++++ .../payment/templates/payment-service.yaml | 14 +++++ etc/k8s/eshoponabp/charts/payment/values.yaml | 28 ++++++++++ etc/k8s/eshoponabp/values.yaml | 26 ++++++++- 6 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 etc/k8s/eshoponabp/charts/payment/Chart.yaml create mode 100644 etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml create mode 100644 etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml create mode 100644 etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml create mode 100644 etc/k8s/eshoponabp/charts/payment/values.yaml diff --git a/etc/k8s/eshoponabp/charts/payment/Chart.yaml b/etc/k8s/eshoponabp/charts/payment/Chart.yaml new file mode 100644 index 00000000..1cb23f7c --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: payment +appVersion: "1.0" +description: eShopOnAbp Payment Microservice +version: 1.0.0 +type: application \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml new file mode 100644 index 00000000..78bcb82e --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__OrderingService" + value: {{ .Values.config.connectionStrings.orderingService }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml new file mode 100644 index 00000000..e843265f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +spec: + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} + rules: + - host: "{{ .Values.ingress.host }}" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }} + port: + number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml new file mode 100644 index 00000000..ee157c01 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/payment/values.yaml b/etc/k8s/eshoponabp/charts/payment/values.yaml new file mode 100644 index 00000000..a4f316a0 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/values.yaml @@ -0,0 +1,28 @@ +config: + selfUrl: # https://eshop-st-payment + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web + connectionStrings: + paymentService: # + administrationService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: eshop-st-payment + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-payment + tag: latest + pullPolicy: IfNotPresent + +env: {} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index f5eb4b19..14f20bcc 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -221,12 +221,12 @@ catalog: tag: latest # ordering-service sub-chart override -catalog: +ordering: config: selfUrl: https://eshop-st-ordering corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public connectionStrings: - orderingService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Ordering;User ID=postgres;password=myPassw0rd; + orderingService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Ordering;User ID=postgres;password=myPassw0rd;Pooling=false" administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" authServer: authority: http://eshop-st-authserver @@ -243,6 +243,28 @@ catalog: repository: "eshoponabp/service-ordering" tag: latest +# payment-service sub-chart override +payment: + config: + selfUrl: https://eshop-st-payment + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public + connectionStrings: + paymentService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Payment;User ID=postgres;password=myPassw0rd;Pooling=false" + administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + ingress: + host: eshop-st-payment + image: + repository: "eshoponabp/service-payment" + tag: latest # Default values for eshoponabp. # This is a YAML-formatted file. From 6ce6963fd0d8fa11be3566b1319213e50becea79 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 9 Feb 2022 02:55:27 +0300 Subject: [PATCH 09/13] updated identityservice data seeding values --- .../templates/identity-deployment.yaml | 20 +++++++++++++------ .../eshoponabp/charts/identity/values.yaml | 6 ++++++ etc/k8s/eshoponabp/values.yaml | 5 +++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml index a7adf73a..e1e8d68c 100644 --- a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml @@ -47,16 +47,24 @@ spec: value: {{ .Values.identityServerClients.webRootUrl }} - name: "IdentityServerClients__PublicWeb__RootUrl" value: {{ .Values.identityServerClients.publicWebRootUrl }} + - name: "IdentityServerClients__PublicWebGateway__RootUrl" + value: {{ .Values.identityServerClients.publicWebRootUrl }} + - name: "IdentityServerClients__WebGateway__RootUrl" + value: {{ .Values.identityServerClients.webGatewayRootUrl }} - name: "IdentityServerClients__IdentityService__RootUrl" value: {{ .Values.identityServerClients.identityServiceRootUrl }} - name: "IdentityServerClients__AdministrationService__RootUrl" value: {{ .Values.identityServerClients.administrationServiceRootUrl }} - - name: "IdentityServerClients__InternalGateway__RootUrl" - value: {{ .Values.identityServerClients.webRootUrl }} - - name: "IdentityServerClients__PublicWebGateway__RootUrl" - value: {{ .Values.identityServerClients.publicWebRootUrl }} - - name: "IdentityServerClients__WebGateway__RootUrl" - value: {{ .Values.identityServerClients.webGatewayRootUrl }} + - name: "IdentityServerClients__AccountService__RootUrl" + value: {{ .Values.identityServerClients.accountServiceRootUrl }} + - name: "IdentityServerClients__BasketService__RootUrl" + value: {{ .Values.identityServerClients.basketServiceRootUrl }} + - name: "IdentityServerClients__CatalogService__RootUrl" + value: {{ .Values.identityServerClients.catalogServiceRootUrl }} + - name: "IdentityServerClients__OrderingService__RootUrl" + value: {{ .Values.identityServerClients.orderingServiceRootUrl }} + - name: "IdentityServerClients__PaymentService__RootUrl" + value: {{ .Values.identityServerClients.paymentServiceRootUrl }} {{- if .Values.env }} {{ toYaml .Values.env | indent 8 }} {{- end }} diff --git a/etc/k8s/eshoponabp/charts/identity/values.yaml b/etc/k8s/eshoponabp/charts/identity/values.yaml index 3710c1b7..f31ac04b 100644 --- a/etc/k8s/eshoponabp/charts/identity/values.yaml +++ b/etc/k8s/eshoponabp/charts/identity/values.yaml @@ -19,8 +19,14 @@ identityServerClients: publicWebRootUrl: # webGatewayRootUrl: # publicWebGatewayRootUrl: # + accountServiceRootUrl: # identityServiceRootUrl: # administrationServiceRootUrl: # + basketServiceRootUrl: # + catalogServiceRootUrl: # + orderingServiceRootUrl: # + paymentServiceRootUrl: # + ingress: host: eshop-st-identity diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 14f20bcc..28716c59 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -69,6 +69,11 @@ identity: publicWebGatewayRootUrl: https://eshop-st-gateway-web-public/ identityServiceRootUrl: https://eshop-st-identity/ administrationServiceRootUrl: https://eshop-st-administration/ + accountServiceRootUrl: https://eshop-st-authserver/ + basketServiceRootUrl: https://eshop-st-basket/ + catalogServiceRootUrl: https://eshop-st-catalog/ + orderingServiceRootUrl: https://eshop-st-ordering/ + paymentServiceRootUrl: https://eshop-st-payment/ ingress: host: eshop-st-identity image: From cff117c2381630e393376f0eb14b9f5d5155a515 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 9 Feb 2022 02:55:43 +0300 Subject: [PATCH 10/13] updated image build scripts --- build/build-images-locally.ps1 | 2 +- build/build-images.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build-images-locally.ps1 b/build/build-images-locally.ps1 index 59030fb2..ec8abf2e 100644 --- a/build/build-images-locally.ps1 +++ b/build/build-images-locally.ps1 @@ -64,7 +64,7 @@ dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-administration:$version . ### BASKET-SERVICE -Write-Host "**************** BUILDING BASKET-SERVICE 8/10 ****************" -ForegroundColor Green +Write-Host "**************** BUILDING BASKET-SERVICE 8/$total ****************" -ForegroundColor Green Set-Location $basketServiceFolder dotnet publish -c Release docker build -f Dockerfile.local -t eshoponabp/service-basket:$version . diff --git a/build/build-images.ps1 b/build/build-images.ps1 index c781b5d0..e5f7c3a2 100644 --- a/build/build-images.ps1 +++ b/build/build-images.ps1 @@ -1,4 +1,4 @@ -param ($version='1.0') +param ($version='latest') $currentFolder = $PSScriptRoot $slnFolder = Join-Path $currentFolder "../" From a8b04429466eafece6f5e5d86465a89eaec424c3 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 9 Feb 2022 03:25:17 +0300 Subject: [PATCH 11/13] updated gateway and authserver values --- .../templates/administration-deployment.yaml | 10 +++++++-- .../charts/administration/values.yaml | 6 +++++- .../templates/authserver-deployment.yaml | 8 +++++++ .../eshoponabp/charts/authserver/values.yaml | 7 ++++++- .../gateway-web-public-configmap.yaml | 6 +++--- .../gateway-web-public-deployment.yaml | 6 +++++- .../charts/gateway-web-public/values.yaml | 8 ++++--- .../templates/gateway-web-deployment.yaml | 6 +++++- .../eshoponabp/charts/gateway-web/values.yaml | 4 +++- .../templates/identity-deployment.yaml | 4 ++++ .../eshoponabp/charts/identity/values.yaml | 2 ++ .../payment/templates/payment-deployment.yaml | 4 ++-- etc/k8s/eshoponabp/values.yaml | 21 +++++++++++++------ 13 files changed, 71 insertions(+), 21 deletions(-) diff --git a/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml b/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml index 2b506bad..7ddc0fe4 100644 --- a/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml @@ -23,8 +23,10 @@ spec: env: - name: App__SelfUrl value: "{{ .Values.config.selfUrl }}" - - name: RemoteServices__Default__BaseUrl - value: "{{ .Values.config.gatewayUrl }}" + - name: RemoteServices__AbpIdentity__BaseUrl + value: "{{ .Values.config.remoteServices.abpIdentityBaseUrl }}" + - name: RemoteServices__AbpIdentity__UseCurrentAccessToken + value: "{{ .Values.config.remoteServices.useCurrentToken }}" - name: App__CorsOrigins value: "{{ .Values.config.corsOrigins }}" - name: IdentityClients__Default__Authority @@ -39,6 +41,10 @@ spec: value: "{{ .Values.config.authServer.authority }}" - name: "AuthServer__RequireHttpsMetadata" value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "StringEncryption__DefaultPassPhrase" value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" - name: "RabbitMQ__Connections__Default__HostName" diff --git a/etc/k8s/eshoponabp/charts/administration/values.yaml b/etc/k8s/eshoponabp/charts/administration/values.yaml index 26aefe9d..5b0f6c97 100644 --- a/etc/k8s/eshoponabp/charts/administration/values.yaml +++ b/etc/k8s/eshoponabp/charts/administration/values.yaml @@ -1,12 +1,16 @@ config: selfUrl: # https://eshop-st-administration - gatewayUrl: # https://eshop-st-gateway-internal/ corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal connectionStrings: administrationService: # authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + remoteServices: + abpIdentityBaseUrl: # + useCurrentToken: "false" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq diff --git a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml index 3ac0b8fe..7db227d3 100644 --- a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml @@ -31,6 +31,14 @@ spec: value: "{{ .Values.config.connectionStrings.identityService }}" - name: "ConnectionStrings__AdministrationService" value: "{{ .Values.config.connectionStrings.administrationService }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "DOTNET_ENVIRONMENT" value: "{{ .Values.config.dotnetEnv }}" - name: "Redis__Configuration" diff --git a/etc/k8s/eshoponabp/charts/authserver/values.yaml b/etc/k8s/eshoponabp/charts/authserver/values.yaml index d80adc30..95f80979 100644 --- a/etc/k8s/eshoponabp/charts/authserver/values.yaml +++ b/etc/k8s/eshoponabp/charts/authserver/values.yaml @@ -4,7 +4,12 @@ config: allowedRedirectUrls: https://eshop-st-web connectionStrings: administrationService: # - identityService: # + identityService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: # redisHost: # rabbitmqHost: # diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml index 88f4794e..809ea92d 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml @@ -61,11 +61,11 @@ data: { "ServiceKey": "Ordering Service", "DownstreamPathTemplate": "/api/ordering/{everything}", - "DownstreamScheme": "{{ .Values.reRoutes.orderService.schema }}", + "DownstreamScheme": "{{ .Values.reRoutes.orderingService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "{{ .Values.reRoutes.orderService.host }}", - "Port": "{{ .Values.reRoutes.orderService.port }}", + "Host": "{{ .Values.reRoutes.orderingService.host }}", + "Port": "{{ .Values.reRoutes.orderingService.port }}", } ], "UpstreamPathTemplate": "/api/ordering/{everything}", diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml index a64d660e..910a6606 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml @@ -38,7 +38,11 @@ spec: - name: "AuthServer__Authority" value: "{{ .Values.config.authServer.authority }}" - name: "AuthServer__RequireHttpsMetadata" - value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "ElasticSearch__Url" value: "{{ .Values.config.elasticsearchHost }}" - name: "StringEncryption__DefaultPassPhrase" diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml index 321eeaca..002e5667 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml @@ -3,7 +3,9 @@ config: globalConfigurationBaseUrl: http://eshop-st-gateway-public-web authServer: authority: http://eshop-st-authserver - requireHttpsMetadata: "false" + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -27,9 +29,9 @@ reRoutes: schema: http host: eshop-st-basket port: 80 - orderService: + orderingService: schema: http - host: eshop-st-order + host: eshop-st-ordering port: 80 ingress: diff --git a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml index 75e1f1a0..25b3f694 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml @@ -40,7 +40,11 @@ spec: - name: "AuthServer__Authority" value: "{{ .Values.config.authServer.authority }}" - name: "AuthServer__RequireHttpsMetadata" - value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "ElasticSearch__Url" value: "{{ .Values.config.elasticsearchHost }}" - name: "StringEncryption__DefaultPassPhrase" diff --git a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml index 40195ae2..a80b0b01 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml @@ -4,7 +4,9 @@ config: globalConfigurationBaseUrl: # http://eshop-st-gateway-web authServer: authority: http://eshop-st-authserver - requireHttpsMetadata: "false" + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: # redisHost: # rabbitmqHost: # diff --git a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml index e1e8d68c..b634a2e2 100644 --- a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml @@ -41,6 +41,10 @@ spec: value: "{{ .Values.config.authServer.authority }}" - name: "AuthServer__RequireHttpsMetadata" value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" - name: "StringEncryption__DefaultPassPhrase" value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" - name: "IdentityServerClients__Web__RootUrl" diff --git a/etc/k8s/eshoponabp/charts/identity/values.yaml b/etc/k8s/eshoponabp/charts/identity/values.yaml index f31ac04b..f7f0faa7 100644 --- a/etc/k8s/eshoponabp/charts/identity/values.yaml +++ b/etc/k8s/eshoponabp/charts/identity/values.yaml @@ -7,6 +7,8 @@ config: authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml index 78bcb82e..c3526b1b 100644 --- a/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml @@ -25,8 +25,8 @@ spec: value: "{{ .Values.config.selfUrl }}" - name: App__CorsOrigins value: "{{ .Values.config.corsOrigins }}" - - name: "ConnectionStrings__OrderingService" - value: {{ .Values.config.connectionStrings.orderingService }} + - name: "ConnectionStrings__PaymentService" + value: {{ .Values.config.connectionStrings.paymentService }} - name: "ConnectionStrings__AdministrationService" value: {{ .Values.config.connectionStrings.administrationService }} - name: "DOTNET_ENVIRONMENT" diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 28716c59..ab84ca38 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -2,13 +2,12 @@ authserver: config: selfUrl: https://eshop-st-authserver - corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-gateway-internal + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-identity,https://eshop-st-administration,https://eshop-st-basket,https://eshop-st-catalog,https://eshop-st-ordering,https://eshop-st-payment allowedRedirectUrls: https://eshop-st-web connectionStrings: administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" identityService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Identity;User ID=postgres;password=myPassw0rd;Pooling=false" dotnetEnv: Staging - globalizationInvariant: 0 #https://docs.microsoft.com/en-us/dotnet/core/runtime-config/globalization redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq elasticsearchHost: es-st-elasticsearch @@ -58,6 +57,8 @@ identity: authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -84,13 +85,17 @@ identity: administration: config: selfUrl: https://eshop-st-administration - gatewayUrl: https://eshop-st-gateway-internal/ corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-gateway-internal connectionStrings: administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + remoteServices: + abpIdentityBaseUrl: https://eshop-st-identity + useCurrentToken: "false" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -112,6 +117,8 @@ gateway-web: authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -138,8 +145,10 @@ gateway-web-public: selfUrl: https://eshop-st-gateway-web-public globalConfigurationBaseUrl: http://eshop-st-gateway-public-web authServer: - authority: http://eshop-st-AUTHSERVER + authority: http://eshop-st-authserver requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq @@ -167,9 +176,9 @@ gateway-web-public: schema: http host: eshop-st-basket port: 80 - orderService: + orderingService: schema: http - host: eshop-st-order + host: eshop-st-ordering port: 80 # basket-service sub-chart override From 13597ac47c1736834c9aa77148fc1830e68eb8c4 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 9 Feb 2022 03:39:25 +0300 Subject: [PATCH 12/13] fixed public web gateway seeding redirect uri error --- .../charts/identity/templates/identity-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml index b634a2e2..00509ce0 100644 --- a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml @@ -52,7 +52,7 @@ spec: - name: "IdentityServerClients__PublicWeb__RootUrl" value: {{ .Values.identityServerClients.publicWebRootUrl }} - name: "IdentityServerClients__PublicWebGateway__RootUrl" - value: {{ .Values.identityServerClients.publicWebRootUrl }} + value: {{ .Values.identityServerClients.publicWebGatewayRootUrl }} - name: "IdentityServerClients__WebGateway__RootUrl" value: {{ .Values.identityServerClients.webGatewayRootUrl }} - name: "IdentityServerClients__IdentityService__RootUrl" From b169dc339250d94c1318054ce6ee8d19e5226e32 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 9 Feb 2022 03:40:03 +0300 Subject: [PATCH 13/13] updated readme --- etc/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/README.md b/etc/README.md index 166c6502..3ff8d9a0 100644 --- a/etc/README.md +++ b/etc/README.md @@ -23,6 +23,10 @@ helm install ingress-nginx ingress-nginx/ingress-nginx 127.0.0.1 eshop-st-authserver 127.0.0.1 eshop-st-identity 127.0.0.1 eshop-st-administration +127.0.0.1 eshop-st-basket +127.0.0.1 eshop-st-catalog +127.0.0.1 eshop-st-ordering +127.0.0.1 eshop-st-payment 127.0.0.1 eshop-st-gateway-web 127.0.0.1 eshop-st-gateway-web-public ````