Browse Source

Merge pull request #20 from abpframework/gterdem/chart_update

eShopOnAbp Kubernetes & helm deployment configuration
pull/21/head
Enis Necipoglu 5 years ago
committed by GitHub
parent
commit
db18a49ae1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/angular/Dockerfile
  2. 21
      apps/angular/dynamic-env.json
  3. 30
      apps/angular/nginx.conf
  4. 8
      apps/angular/src/environments/environment.prod.ts
  5. 2
      apps/angular/src/environments/environment.ts
  6. 4
      apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj
  7. 61
      apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs
  8. BIN
      apps/auth-server/src/EShopOnAbp.AuthServer/eshoponabp-authserver.pfx
  9. 4
      apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs
  10. 2
      apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json
  11. 19
      etc/k8s/README.md
  12. 2
      etc/k8s/deploy-staging.ps1
  13. 10
      etc/k8s/eshoponabp/charts/administration/values.yaml
  14. 6
      etc/k8s/eshoponabp/charts/authserver/templates/authserver.yaml
  15. 8
      etc/k8s/eshoponabp/charts/authserver/values.yaml
  16. 17
      etc/k8s/eshoponabp/charts/consul/templates/consul-service.yaml
  17. 24
      etc/k8s/eshoponabp/charts/consul/templates/consul.yaml
  18. 0
      etc/k8s/eshoponabp/charts/consul/values.yaml
  19. 6
      etc/k8s/eshoponabp/charts/gateway-internal/Chart.yaml
  20. 113
      etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-configmap.yaml
  21. 37
      etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-ingress.yaml
  22. 0
      etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-service.yaml
  23. 34
      etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal.yaml
  24. 35
      etc/k8s/eshoponabp/charts/gateway-internal/values.yaml
  25. 4
      etc/k8s/eshoponabp/charts/gateway-public-web/Chart.yaml
  26. 74
      etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-configmap.yaml
  27. 37
      etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-ingress.yaml
  28. 14
      etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-service.yaml
  29. 34
      etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web.yaml
  30. 18
      etc/k8s/eshoponabp/charts/gateway-public-web/values.yaml
  31. 4
      etc/k8s/eshoponabp/charts/gateway-web/Chart.yaml
  32. 100
      etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml
  33. 37
      etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-ingress.yaml
  34. 14
      etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-service.yaml
  35. 34
      etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web.yaml
  36. 37
      etc/k8s/eshoponabp/charts/gateway-web/values.yaml
  37. 4
      etc/k8s/eshoponabp/charts/identity/templates/identity.yaml
  38. 22
      etc/k8s/eshoponabp/charts/identity/values.yaml
  39. 5
      etc/k8s/eshoponabp/charts/public-web/templates/public-web.yaml
  40. 6
      etc/k8s/eshoponabp/charts/public-web/values.yaml
  41. 0
      etc/k8s/eshoponabp/charts/public-webgateway/values.yaml
  42. 4
      etc/k8s/eshoponabp/charts/saas/templates/saas-ingress.yaml
  43. 5
      etc/k8s/eshoponabp/charts/saas/templates/saas.yaml
  44. 6
      etc/k8s/eshoponabp/charts/saas/values.yaml
  45. 4
      etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver.yaml
  46. 6
      etc/k8s/eshoponabp/charts/web/Chart.yaml
  47. 8
      etc/k8s/eshoponabp/charts/web/templates/web-ingress.yaml
  48. 14
      etc/k8s/eshoponabp/charts/web/templates/web-service.yaml
  49. 5
      etc/k8s/eshoponabp/charts/web/templates/web.yaml
  50. 3
      etc/k8s/eshoponabp/charts/web/values.yaml
  51. 6
      etc/k8s/eshoponabp/templates/_helpers.tpl
  52. 57
      etc/k8s/eshoponabp/values.yaml
  53. 3
      etc/scripts/build-images.ps1
  54. 4
      gateways/internal/src/EShopOnAbp.InternalGateway/EShopOnAbpInternalGatewayModule.cs
  55. 7
      gateways/internal/src/EShopOnAbp.InternalGateway/appsettings.json
  56. 4
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs
  57. 2
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/Program.cs
  58. 7
      gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json
  59. 4
      gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs
  60. 7
      gateways/web/src/EShopOnAbp.WebGateway/appsettings.json
  61. 5
      services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/appsettings.json
  62. 8
      services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServerDataSeeder.cs
  63. 18
      services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json
  64. 5
      services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json

4
apps/angular/Dockerfile

@ -1,3 +1,5 @@
FROM nginx:alpine
WORKDIR /app
COPY dist/EShopOnAbp /usr/share/nginx/html
COPY dist/EShopOnAbp /usr/share/nginx/html
COPY dynamic-env.json /usr/share/nginx/html
COPY /nginx.conf /etc/nginx/conf.d/default.conf

21
apps/angular/dynamic-env.json

@ -0,0 +1,21 @@
{
"production": true,
"application": {
"baseUrl":"https://eshop-st-web",
"name": "EShopOnAbp",
"logoUrl": ""
},
"oAuthConfig": {
"issuer": "https://eshop-st-authserver",
"redirectUri": "https://eshop-st-web",
"clientId": "EShopOnAbp_App",
"responseType": "code",
"scope": "offline_access openid profile email phone IdentityService AdministrationService SaasService"
},
"apis": {
"default": {
"url": "https://eshop-st-gateway-web",
"rootNamespace": "EShopOnAbp"
}
}
}

30
apps/angular/nginx.conf

@ -0,0 +1,30 @@
server {
listen 80;
listen [::]:80;
server_name _;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
location /getEnvConfig {
default_type 'application/json';
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Content-Type' 'application/json';
try_files $uri /dynamic-env.json;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

8
apps/angular/src/environments/environment.prod.ts

@ -12,9 +12,9 @@ export const environment = {
oAuthConfig: {
issuer: 'https://localhost:44394',
redirectUri: baseUrl,
clientId: 'EShopOnAbp_App',
clientId: 'Web',
responseType: 'code',
scope: 'offline_access EShopOnAbp',
scope: 'offline_access openid profile email phone IdentityService AdministrationService SaasService',
},
apis: {
default: {
@ -22,4 +22,8 @@ export const environment = {
rootNamespace: 'EShopOnAbp',
},
},
remoteEnv:{
url: "/getEnvConfig",
mergeStrategy:'deepmerge'
}
} as Environment;

2
apps/angular/src/environments/environment.ts

@ -11,7 +11,7 @@ export const environment = {
oAuthConfig: {
issuer: 'https://localhost:44330',
redirectUri: baseUrl,
clientId: 'EShopOnAbp_Angular',
clientId: 'Web',
responseType: 'code',
scope:
'offline_access openid profile email phone IdentityService AdministrationService SaasService',

4
apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj

@ -35,6 +35,10 @@
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
<None Remove="eshoponabp-authserver.pfx" />
<Content Include="eshoponabp-authserver.pfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

61
apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs

@ -12,6 +12,11 @@ using StackExchange.Redis;
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using IdentityServer4.Configuration;
using IdentityServer4.Extensions;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Account.Web;
@ -23,6 +28,7 @@ using Volo.Abp.Caching;
using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.Emailing;
using Volo.Abp.EventBus.RabbitMq;
using Volo.Abp.IdentityServer;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.UI.Navigation.Urls;
@ -45,10 +51,50 @@ namespace EShopOnAbp.AuthServer
)]
public class EShopOnAbpAuthServerModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
if (!hostingEnvironment.IsDevelopment())
{
var configuration = context.Services.GetConfiguration();
PreConfigure<AbpIdentityServerBuilderOptions>(options =>
{
options.AddDeveloperSigningCredential = false;
});
PreConfigure<IIdentityServerBuilder>(builder =>
{
builder.AddSigningCredential(GetSigningCertificate(hostingEnvironment, configuration));
});
}
}
private X509Certificate2 GetSigningCertificate(IWebHostEnvironment hostingEnv, IConfiguration configuration)
{
var fileName = "eshoponabp-authserver.pfx";
var passPhrase = "780F3C11-0A96-40DE-B335-9848BE88C77D";
var file = Path.Combine(hostingEnv.ContentRootPath, fileName);
if (!File.Exists(file))
{
throw new FileNotFoundException($"Signing Certificate couldn't found: {file}");
}
return new X509Certificate2(file, passPhrase);
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
Configure<IdentityServerOptions>(options =>
{
options.IssuerUri = configuration["App:SelfUrl"];
});
Configure<AbpMultiTenancyOptions>(options =>
{
@ -74,7 +120,8 @@ namespace EShopOnAbp.AuthServer
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "EShopOnAbp-Protection-Keys");
.PersistKeysToStackExchangeRedis(redis, "EShopOnAbp-Protection-Keys")
.SetApplicationName("eShopOnAbp-AuthServer");
context.Services.AddCors(options =>
{
@ -114,10 +161,16 @@ namespace EShopOnAbp.AuthServer
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.Use((ctx, next) =>
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
app.Use(async (ctx, next) =>
{
ctx.Request.Scheme = "https";
return next();
if (ctx.Request.Headers.ContainsKey("from-ingress"))
{
ctx.SetIdentityServerOrigin(configuration["App:SelfUrl"]);
}
await next();
});
if (env.IsDevelopment())

BIN
apps/auth-server/src/EShopOnAbp.AuthServer/eshoponabp-authserver.pfx

Binary file not shown.

4
apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs

@ -55,6 +55,7 @@ namespace EShopOnAbp.PublicWeb
public override void ConfigureServices(ServiceConfigurationContext context)
{
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
@ -104,7 +105,8 @@ namespace EShopOnAbp.PublicWeb
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
.PersistKeysToStackExchangeRedis(redis, "EShopOnAbp-Protection-Keys")
.SetApplicationName("eShopOnAbp-PublicWeb");
Configure<AbpNavigationOptions>(options =>
{

2
apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json

@ -38,7 +38,7 @@
"AuthServer": {
"Authority": "https://localhost:44330",
"RequireHttpsMetadata": "true",
"ClientId": "EShopOnAbp_PublicWeb",
"ClientId": "PublicWeb",
"ClientSecret": "1q2w3e*"
}
}

19
etc/k8s/README.md

@ -4,7 +4,7 @@
* Install [NGINX ingress](https://kubernetes.github.io/ingress-nginx/deploy/) for k8s
OR
* Install NGINX ingress using helm
```
```powershell
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
@ -17,13 +17,16 @@ helm install ingress-nginx ingress-nginx/ingress-nginx
* Add entries to the hosts file (in Windows: `C:\Windows\System32\drivers\etc\hosts`):
````
127.0.0.1 eshoponabp-public-web
127.0.0.1 eshoponabp-authserver
127.0.0.1 eshoponabp-identity
127.0.0.1 eshoponabp-administration
127.0.0.1 eshoponabp-saas
127.0.0.1 eshoponabp-public-webgateway
````powershell
127.0.0.1 eshop-st-web
127.0.0.1 eshop-st-public-web
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-saas
127.0.0.1 eshop-st-gateway-web
127.0.0.1 eshop-st-gateway-public-web
127.0.0.1 eshop-st-gateway-internal
````
* Run `build-images.ps1` in the `scripts` directory.

2
etc/k8s/deploy-staging.ps1

@ -1,3 +1,3 @@
param ($version='latest')
helm upgrade --install eshoponabp eshoponabp --namespace eshop --create-namespace --set global.eshoponabpImageVersion=$version
helm upgrade --install es-st eshoponabp --namespace eshop --create-namespace --set global.eshoponabpImageVersion=$version

10
etc/k8s/eshoponabp/charts/administration/values.yaml

@ -0,0 +1,10 @@
env:
- name: "App__SelfUrl"
value: "https://eshop-st-administration"
- name: "App__CorsOrigins"
value: "https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal"
- name: "RemoteServices__Default__BaseUrl"
value: "https://eshop-st-gateway-internal/"
- name: "IdentityClients__IdentityClients__Authority"
value: "https://eshop-st-authserver"

6
etc/k8s/eshoponabp/charts/authserver/templates/authserver.yaml

@ -27,4 +27,8 @@ spec:
- name: "ConnectionStrings__AdministrationService"
value: {{ .Values.global.administrationService.connString }}
- name: "ConnectionStrings__SaasService"
value: {{ .Values.global.saasService.connString }}
value: {{ .Values.global.saasService.connString }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 8 }}
{{- end }}

8
etc/k8s/eshoponabp/charts/authserver/values.yaml

@ -0,0 +1,8 @@
env:
- name: "App__SelfUrl"
value: "https://eshop-st-authserver"
- name: "App__CorsOrigins"
value: "https://eshop-st-identity,https://eshop-st-administration,https://eshop-st-saas"
- name: "App__RedirectAllowedUrls"
value: "http://localhost:4200"

17
etc/k8s/eshoponabp/charts/consul/templates/consul-service.yaml

@ -1,17 +0,0 @@
apiVersion: v1
kind: Service
metadata:
labels:
name: {{ .Release.Name }}-{{ .Chart.Name }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
type: ClusterIP
ports:
- name: consul-1
protocol: TCP
port: 8500
- name: consul-2
protocol: TCP
port: 8600
selector:
app: {{ .Release.Name }}-{{ .Chart.Name }}

24
etc/k8s/eshoponabp/charts/consul/templates/consul.yaml

@ -1,24 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: consul
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: consul-1
protocol: TCP
containerPort: 8500
- name: consul-2
protocol: TCP
containerPort: 8600

0
etc/k8s/eshoponabp/charts/consul/values.yaml

6
etc/k8s/eshoponabp/charts/gateway-internal/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: gateway-internal
appVersion: "1.0"
description: eShopOnAbp Internal Web Gateway Application
version: 1.0.0
type: application

113
etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-configmap.yaml

@ -0,0 +1,113 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap
data:
appsettings.json: |-
{
"Routes": [
{
"ServiceKey": "Identity Service",
"DownstreamPathTemplate": "/api/identity/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-identity",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/identity/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Identity Service",
"DownstreamPathTemplate": "/api/account/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-identity",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/account/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Saas Service",
"DownstreamPathTemplate": "/api/saas/{everything}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-saas",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/saas/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Administration Service",
"DownstreamPathTemplate": "/api/abp/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-administration",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/abp/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Administration Service",
"DownstreamPathTemplate": "/api/feature-management/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-administration",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/feature-management/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Administration Service",
"DownstreamPathTemplate": "/api/permission-management/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-administration",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/permission-management/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Administration Service",
"DownstreamPathTemplate": "/api/setting-management/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-administration",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/setting-management/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Payment Service",
"DownstreamPathTemplate": "/api/payment/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-payment",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/payment/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
}]
}

37
etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-ingress.yaml

@ -0,0 +1,37 @@
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: "{{ .Values.global.nginxProxyBufferSize }}"
nginx.ingress.kubernetes.io/proxy-buffers-number: "{{ .Values.global.nginxProxyBuffersNumber }}"
{{- if eq .Release.Name "es-az" }}
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
{{- end }}
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts:
- {{ .Values.global.gatewayInternal.domain }}
{{- if eq .Release.Name "es-az" }}
- {{ print "www." .Values.global.gatewayInternal.domain }}
{{- end }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
{{- if eq .Release.Name "es-az" }}
- host: "{{ print "www." .Values.global.gatewayInternal.domain }}"
{{- else }}
- host: "{{ .Values.global.gatewayInternal.domain }}"
{{- end }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

0
etc/k8s/eshoponabp/charts/public-webgateway/templates/public-webgateway-service.yaml → etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-service.yaml

34
etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal.yaml

@ -0,0 +1,34 @@
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.global.gatewayInternal.containerImage }}:{{ .Values.global.eshoponabpImageVersion }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
volumeMounts:
- name: config-volume
mountPath: /app/config
env:
{{ include "eshoponabp.global.env" . | indent 8 }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 8 }}
{{- end }}
volumes:
- name: config-volume
configMap:
name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap

35
etc/k8s/eshoponabp/charts/gateway-internal/values.yaml

@ -0,0 +1,35 @@
env:
- name: "App__SelfUrl"
value: "https://eshop-st-gateway-internal"
- name: "GlobalConfiguration__BaseUrl"
value: "http://eshop-st-gateway-internal"
- name: "Routes__0__DownstreamScheme"
value: "http"
- name: "Routes__0__DownstreamHostAndPorts__0__Host"
value: "eshop-st-identity"
- name: "Routes__0__DownstreamHostAndPorts__0__Port"
value: "80"
- name: "Routes__1__DownstreamScheme"
value: "http"
- name: "Routes__1__DownstreamHostAndPorts__0__Host"
value: "eshop-st-identity"
- name: "Routes__1__DownstreamHostAndPorts__0__Port"
value: "80"
- name: "Routes__2__DownstreamScheme"
value: "http"
- name: "Routes__2__DownstreamHostAndPorts__0__Host"
value: "eshop-st-saas"
- name: "Routes__2__DownstreamHostAndPorts__0__Port"
value: "80"
- name: "Routes__3__DownstreamScheme"
value: "http"
- name: "Routes__3__DownstreamHostAndPorts__0__Host"
value: "eshop-st-administration"
- name: "Routes__3__DownstreamHostAndPorts__0__Port"
value: "80"
- name: "Routes__4__DownstreamScheme"
value: "http"
- name: "Routes__4__DownstreamHostAndPorts__0__Host"
value: "eshop-st-administration"
- name: "Routes__4__DownstreamHostAndPorts__0__Port"
value: "80"

4
etc/k8s/eshoponabp/charts/public-webgateway/Chart.yaml → etc/k8s/eshoponabp/charts/gateway-public-web/Chart.yaml

@ -1,6 +1,6 @@
apiVersion: v2
name: public-webgateway
name: gateway-public-web
appVersion: "1.0"
description: eShopOnAbp Public Web Gateway Application
version: 1.0.0
type: application
type: application

74
etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-configmap.yaml

@ -0,0 +1,74 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap
data:
appsettings.json: |-
{
"Routes": [
{
"ServiceKey": "Identity Service",
"DownstreamPathTemplate": "/api/account/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-identity",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/account/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Administration Service",
"DownstreamPathTemplate": "/api/abp/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-administration",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/abp/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Catalog Service",
"DownstreamPathTemplate": "/api/catalog/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-catalog",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/catalog/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Basket Service",
"DownstreamPathTemplate": "/api/basket/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-basket",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/basket/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Ordering Service",
"DownstreamPathTemplate": "/api/ordering/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-ordering",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/ordering/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
}]
}

37
etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-ingress.yaml

@ -0,0 +1,37 @@
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: "{{ .Values.global.nginxProxyBufferSize }}"
nginx.ingress.kubernetes.io/proxy-buffers-number: "{{ .Values.global.nginxProxyBuffersNumber }}"
{{- if eq .Release.Name "es-az" }}
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
{{- end }}
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts:
- {{ .Values.global.gatewayPublicWeb.domain }}
{{- if eq .Release.Name "es-az" }}
- {{ print "www." .Values.global.gatewayPublicWeb.domain }}
{{- end }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
{{- if eq .Release.Name "es-az" }}
- host: "{{ print "www." .Values.global.gatewayPublicWeb.domain }}"
{{- else }}
- host: "{{ .Values.global.gatewayPublicWeb.domain }}"
{{- end }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

14
etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-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 }}

34
etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web.yaml

@ -0,0 +1,34 @@
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.global.gatewayPublicWeb.containerImage }}:{{ .Values.global.eshoponabpImageVersion }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
volumeMounts:
- name: config-volume
mountPath: /app/config
env:
{{ include "eshoponabp.global.env" . | indent 8 }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 8 }}
{{- end }}
volumes:
- name: config-volume
configMap:
name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap

18
etc/k8s/eshoponabp/charts/gateway-public-web/values.yaml

@ -0,0 +1,18 @@
env:
- name: "App__SelfUrl"
value: "https://eshop-st-gateway-public-web"
- name: "GlobalConfiguration__BaseUrl"
value: "http://eshop-st-gateway-public-web"
- name: "Routes__0__DownstreamScheme"
value: "http"
- name: "Routes__0__DownstreamHostAndPorts__0__Host"
value: "eshop-st-identity"
- name: "Routes__0__DownstreamHostAndPorts__0__Port"
value: "80"
- name: "Routes__1__DownstreamScheme"
value: "http"
- name: "Routes__1__DownstreamHostAndPorts__0__Host"
value: "eshop-st-administration"
- name: "Routes__1__DownstreamHostAndPorts__0__Port"
value: "80"

4
etc/k8s/eshoponabp/charts/consul/Chart.yaml → etc/k8s/eshoponabp/charts/gateway-web/Chart.yaml

@ -1,6 +1,6 @@
apiVersion: v2
name: consul
name: gateway-web
appVersion: "1.0"
description: Runs Consul instance
description: eShopOnAbp Web Gateway Application
version: 1.0.0
type: application

100
etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml

@ -0,0 +1,100 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap
data:
appsettings.json: |-
{
"Routes": [
{
"ServiceKey": "Identity Service",
"DownstreamPathTemplate": "/api/identity/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-identity",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/identity/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Identity Service",
"DownstreamPathTemplate": "/api/account/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-identity",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/account/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Saas Service",
"DownstreamPathTemplate": "/api/saas/{everything}",
"DownstreamScheme": "https",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-saas",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/saas/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Administration Service",
"DownstreamPathTemplate": "/api/abp/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-administration",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/abp/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Administration Service",
"DownstreamPathTemplate": "/api/feature-management/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-administration",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/feature-management/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Administration Service",
"DownstreamPathTemplate": "/api/permission-management/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-administration",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/permission-management/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"ServiceKey": "Administration Service",
"DownstreamPathTemplate": "/api/setting-management/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "eshop-st-administration",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/setting-management/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
}]
}

37
etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-ingress.yaml

@ -0,0 +1,37 @@
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: "{{ .Values.global.nginxProxyBufferSize }}"
nginx.ingress.kubernetes.io/proxy-buffers-number: "{{ .Values.global.nginxProxyBuffersNumber }}"
{{- if eq .Release.Name "es-az" }}
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
{{- end }}
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts:
- {{ .Values.global.gatewayWeb.domain }}
{{- if eq .Release.Name "es-az" }}
- {{ print "www." .Values.global.gatewayWeb.domain }}
{{- end }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
{{- if eq .Release.Name "es-az" }}
- host: "{{ print "www." .Values.global.gatewayWeb.domain }}"
{{- else }}
- host: "{{ .Values.global.gatewayWeb.domain }}"
{{- end }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

14
etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-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 }}

34
etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web.yaml

@ -0,0 +1,34 @@
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.global.gatewayWeb.containerImage }}:{{ .Values.global.eshoponabpImageVersion }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
volumeMounts:
- name: config-volume
mountPath: /app/config
env:
{{ include "eshoponabp.global.env" . | indent 8 }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 8 }}
{{- end }}
volumes:
- name: config-volume
configMap:
name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap

37
etc/k8s/eshoponabp/charts/gateway-web/values.yaml

@ -0,0 +1,37 @@
env:
- name: "App__SelfUrl"
value: "https://eshop-st-gateway-web"
- name: "App__CorsOrigins"
value: "https://eshop-st-web"
- name: "GlobalConfiguration__BaseUrl"
value: "http://eshop-st-gateway-web"
- name: "Routes__0__DownstreamScheme"
value: "http"
- name: "Routes__0__DownstreamHostAndPorts__0__Host"
value: "eshop-st-identity"
- name: "Routes__0__DownstreamHostAndPorts__0__Port"
value: "80"
- name: "Routes__1__DownstreamScheme"
value: "http"
- name: "Routes__1__DownstreamHostAndPorts__0__Host"
value: "eshop-st-identity"
- name: "Routes__1__DownstreamHostAndPorts__0__Port"
value: "80"
- name: "Routes__2__DownstreamScheme"
value: "http"
- name: "Routes__2__DownstreamHostAndPorts__0__Host"
value: "eshop-st-saas"
- name: "Routes__2__DownstreamHostAndPorts__0__Port"
value: "80"
- name: "Routes__3__DownstreamScheme"
value: "http"
- name: "Routes__3__DownstreamHostAndPorts__0__Host"
value: "eshop-st-administration"
- name: "Routes__3__DownstreamHostAndPorts__0__Port"
value: "80"
- name: "Routes__4__DownstreamScheme"
value: "http"
- name: "Routes__4__DownstreamHostAndPorts__0__Host"
value: "eshop-st-administration"
- name: "Routes__4__DownstreamHostAndPorts__0__Port"
value: "80"

4
etc/k8s/eshoponabp/charts/identity/templates/identity.yaml

@ -28,4 +28,6 @@ spec:
value: {{ .Values.global.administrationService.connString }}
- name: "ConnectionStrings__SaasService"
value: {{ .Values.global.saasService.connString }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 8 }}
{{- end }}

22
etc/k8s/eshoponabp/charts/identity/values.yaml

@ -0,0 +1,22 @@
env:
- name: "App__SelfUrl"
value: "https://eshop-st-identity"
- name: "App__CorsOrigins"
value: "https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal"
- name: "IdentityServerClients__Web__RootUrl"
value: "https://eshop-st-web/"
- name: "IdentityServerClients__PublicWeb__RootUrl"
value: "https://eshop-st-public-web/"
- name: "IdentityServerClients__IdentityService__RootUrl"
value: "https://eshop-st-identity/"
- name: "IdentityServerClients__SaasService__RootUrl"
value: "https://eshop-st-saas/"
- name: "IdentityServerClients__AdministrationService__RootUrl"
value: "https://eshop-st-administration/"
- name: "IdentityServerClients__InternalGateway__RootUrl"
value: "https://eshop-st-gateway-internal/"
- name: "IdentityServerClients__PublicWebGateway__RootUrl"
value: "https://eshop-st-gateway-public-web/"
- name: "IdentityServerClients__WebGateway__RootUrl"
value: "https://eshop-st-gateway-web/"

5
etc/k8s/eshoponabp/charts/public-web/templates/public-web.yaml

@ -22,5 +22,6 @@ spec:
containerPort: 443
env:
{{ include "eshoponabp.global.env" . | indent 8 }}
- name: "RemoteServices__Default__BaseUrl"
value: {{ .Values.global.publicWeb.remoteServiceUrl }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 8 }}
{{- end }}

6
etc/k8s/eshoponabp/charts/public-web/values.yaml

@ -0,0 +1,6 @@
env:
- name: "App__SelfUrl"
value: "https://eshop-st-public-web"
- name: "RemoteServices__Default__BaseUrl"
value: "http://eshop-st-gateway-public-web/"

0
etc/k8s/eshoponabp/charts/public-webgateway/values.yaml

4
etc/k8s/eshoponabp/charts/saas/templates/saas-ingress.yaml

@ -12,10 +12,10 @@ metadata:
spec:
tls:
- hosts:
- {{ .Values.global.identityService.domain }}
- {{ .Values.global.saasService.domain }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
- host: "{{ .Values.global.identityService.domain }}"
- host: "{{ .Values.global.saasService.domain }}"
http:
paths:
- path: /

5
etc/k8s/eshoponabp/charts/saas/templates/saas.yaml

@ -25,5 +25,8 @@ spec:
- name: "ConnectionStrings__AdministrationService"
value: {{ .Values.global.administrationService.connString }}
- name: "ConnectionStrings__SaasService"
value: {{ .Values.global.saasService.connString }}
value: {{ .Values.global.saasService.connString }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 8 }}
{{- end }}

6
etc/k8s/eshoponabp/charts/saas/values.yaml

@ -0,0 +1,6 @@
env:
- name: "App__SelfUrl"
value: "https://eshop-st-saas"
- name: "App__CorsOrigins"
value: "https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal"

4
etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver.yaml

@ -16,7 +16,7 @@ spec:
containers:
- image: mcr.microsoft.com/mssql/server
name: {{ .Release.Name }}-{{ .Chart.Name }}
{{- if eq .Release.Name "eh-az" }}
{{- if eq .Release.Name "es-az" }}
volumeMounts:
- mountPath: "/var/opt/mssql"
name: {{ .Release.Name }}-{{ .Chart.Name }}-database-volume
@ -30,7 +30,7 @@ spec:
value: "myPassw@rd"
- name: ACCEPT_EULA
value: "Y"
{{- if eq .Release.Name "eh-az" }}
{{- if eq .Release.Name "es-az" }}
volumeClaimTemplates:
- metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-database-volume

6
etc/k8s/eshoponabp/charts/web/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: web
appVersion: "1.0"
description: eShopOnAbp BackOffice Web Application
version: 1.0.0
type: application

8
etc/k8s/eshoponabp/charts/public-webgateway/templates/public-webgateway-ingress.yaml → etc/k8s/eshoponabp/charts/web/templates/web-ingress.yaml

@ -15,16 +15,16 @@ metadata:
spec:
tls:
- hosts:
- {{ .Values.global.publicWebGateway.domain }}
- {{ .Values.global.web.domain }}
{{- if eq .Release.Name "eh-az" }}
- {{ print "www." .Values.global.publicWebGateway.domain }}
- {{ print "www." .Values.global.web.domain }}
{{- end }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
{{- if eq .Release.Name "eh-az" }}
- host: "{{ print "www." .Values.global.publicWebGateway.domain }}"
- host: "{{ print "www." .Values.global.web.domain }}"
{{- else }}
- host: "{{ .Values.global.publicWebGateway.domain }}"
- host: "{{ .Values.global.web.domain }}"
{{- end }}
http:
paths:

14
etc/k8s/eshoponabp/charts/web/templates/web-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 }}

5
etc/k8s/eshoponabp/charts/public-webgateway/templates/public-webgateway.yaml → etc/k8s/eshoponabp/charts/web/templates/web.yaml

@ -12,7 +12,7 @@ spec:
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: {{ .Values.global.publicWebGateway.containerImage }}:{{ .Values.global.eshoponabpImageVersion }}
- image: {{ .Values.global.web.containerImage }}:{{ .Values.global.eshoponabpImageVersion }}
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
@ -22,3 +22,6 @@ spec:
containerPort: 443
env:
{{ include "eshoponabp.global.env" . | indent 8 }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 8 }}
{{- end }}

3
etc/k8s/eshoponabp/charts/web/values.yaml

@ -0,0 +1,3 @@
env:
- name: "BASE_URL"
value: "https://eshop-st-web"

6
etc/k8s/eshoponabp/templates/_helpers.tpl

@ -64,8 +64,6 @@ Create the name of the service account to use
{{- define "eshoponabp.global.env" -}}
- name: "DOTNET_ENVIRONMENT"
value: "{{ .Values.global.dotnetEnvironment }}"
- name: "AppUrls__ApiInternal"
value: "{{ .Values.global.apiUrlInternal }}"
- name: "Redis__Configuration"
value: "{{ .Values.global.redisConfiguration }}"
- name: "AuthServer__Authority"
@ -76,6 +74,6 @@ Create the name of the service account to use
value: "{{ .Values.global.stringEncryptionDefaultPassPhrase }}"
- name: "RabbitMQ__Connections__Default__HostName"
value: "{{ .Values.global.rabbitMqHostName }}"
- name: "Consul__Host"
value: "{{ .Values.global.consulHostname }}"
- name: "ElasticSearch__Url"
value: "{{ .Values.global.elasticSearchUrl }}"
{{- end }}

57
etc/k8s/eshoponabp/values.yaml

@ -10,8 +10,8 @@ image:
# Overrides the image tag whose default is the chart appVersion.
tag: ""
administration:
env:
# administration:
# env:
# - name: "ADMIN_SPECIFIC_ENV_NAME"
# value: "ADMIN_SPECIFIC_ENV_VALUE"
@ -90,39 +90,50 @@ global:
dotnetEnvironment: "Staging"
imagePullPolicy: Never
eshoponabpImageVersion: latest
web:
domain: eshop-st-web
url: https://eshop-st-web
containerImage: "eshoponabp/app-web"
publicWeb:
domain: eshoponabp-public-web
url: https://eshoponabp-public-web
domain: eshop-st-public-web
url: https://eshop-st-public-web
containerImage: "eshoponabp/app-publicweb"
remoteServiceUrl: http://eshoponabp-public-webgateway
authServer:
domain: eshoponabp-authserver
url: https://eshoponabp-authserver
domain: eshop-st-authserver
url: https://eshop-st-authserver
containerImage: "eshoponabp/app-authserver"
identityService:
domain: eshoponabp-identity
url: https://eshoponabp-identity
domain: eshop-st-identity
url: https://eshop-st-identity
containerImage: "eshoponabp/service-identity"
connString: "Server=eshoponabp-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true"
connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true"
administrationService:
domain: eshoponabp-administration
url: https://eshoponabp-administration
domain: eshop-st-administration
url: https://eshop-st-administration
containerImage: "eshoponabp/service-administration"
connString: "Server=eshoponabp-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true"
connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true"
saasService:
domain: eshoponabp-saas
url: https://eshoponabp-saas
domain: eshop-st-saas
url: https://eshop-st-saas
containerImage: "eshoponabp/service-saas"
connString: "Server=eshoponabp-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true"
publicWebGateway:
domain: eshoponabp-public-webgateway
url: https://eshoponabp-public-webgateway
connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true"
gatewayWeb:
domain: eshop-st-gateway-web
url: https://eshop-st-gateway-web
containerImage: "eshoponabp/gateway-web"
gatewayPublicWeb:
domain: eshop-st-gateway-public-web
url: https://eshop-st-gateway-public-web
containerImage: "eshoponabp/gateway-publicweb"
redisConfiguration: "eshoponabp-redis"
rabbitMqHostName: "eshoponabp-rabbitmq"
consulHostname: "http://eshoponabp-consul"
gatewayInternal:
domain: eshop-st-gateway-internal
url: https://eshop-st-gateway-internal
containerImage: "eshoponabp/gateway-internal"
redisConfiguration: "es-st-redis"
rabbitMqHostName: "es-st-rabbitmq"
elasticSearchUrl: ""
nginxProxyBufferSize: "32k"
nginxProxyBuffersNumber: "8"
internalAuthServerAuthority: "http://eshoponabp-authserver"
internalAuthServerAuthority: "http://eshop-st-authserver"
internalAuthServerRequireHttpsMetadata: "false"
stringEncryptionDefaultPassPhrase: "gsKnGZ041HLL4IM8"

3
etc/scripts/build-images.ps1

@ -18,7 +18,8 @@ $saasServiceFolder = Join-Path $slnFolder "services/saas/src/EShopOnAbp.SaasServ
Write-Host "*** BUILDING WEB (WWW) ****************" -ForegroundColor Green
Set-Location $webAppFolder
yarn
ng build --prod
# ng build --prod
npm run build:prod
docker build -t eshoponabp/app-web:$version .
### AUTH-SERVER

4
gateways/internal/src/EShopOnAbp.InternalGateway/EShopOnAbpInternalGatewayModule.cs

@ -45,6 +45,10 @@ namespace EShopOnAbp.InternalGateway
{
var url =
$"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}";
if (!env.IsDevelopment())
{
url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}";
}
options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);

7
gateways/internal/src/EShopOnAbp.InternalGateway/appsettings.json

@ -61,7 +61,12 @@
}
],
"UpstreamPathTemplate": "/api/abp/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ],
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 5,
"DurationOfBreak": 3000,
"TimeoutValue": 2500
}
},
{
"ServiceKey": "Administration Service",

4
gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs

@ -45,6 +45,10 @@ namespace EShopOnAbp.WebPublicGateway
{
var url =
$"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}";
if (!env.IsDevelopment())
{
url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}";
}
options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);

2
gateways/web-public/src/EShopOnAbp.WebPublicGateway/Program.cs

@ -37,7 +37,7 @@ namespace EShopOnAbp.WebPublicGateway
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(build =>
{
build.AddJsonFile("appsettings.secrets.json", optional: true);
build.AddJsonFile("appsettings.secrets.json", optional: true, reloadOnChange:true);
})
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); })
.UseAutofac()

7
gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json

@ -42,7 +42,12 @@
}
],
"UpstreamPathTemplate": "/api/abp/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ],
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 3,
"DurationOfBreak": 3000,
"TimeoutValue": 2500
}
},
{
"ServiceKey": "Catalog Service",

4
gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs

@ -48,6 +48,10 @@ namespace EShopOnAbp.WebGateway
{
var url =
$"{config.DownstreamScheme}://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}:{config.DownstreamHostAndPorts.FirstOrDefault()?.Port}";
if (!env.IsDevelopment())
{
url = $"https://{config.DownstreamHostAndPorts.FirstOrDefault()?.Host}";
}
options.SwaggerEndpoint($"{url}/swagger/v1/swagger.json", $"{config.ServiceKey} API");
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);

7
gateways/web/src/EShopOnAbp.WebGateway/appsettings.json

@ -68,7 +68,12 @@
}
],
"UpstreamPathTemplate": "/api/abp/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ],
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 3,
"DurationOfBreak": 5000,
"TimeoutValue": 2500
}
},
{
"ServiceKey": "Administration Service",

5
services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/appsettings.json

@ -55,10 +55,5 @@
},
"ElasticSearch": {
"Url": "http://localhost:9200"
},
"Consul": {
"Enabled": true,
"Host": "http://localhost:8500",
"Service": "Administration Service"
}
}

8
services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/DbMigrations/IdentityServerDataSeeder.cs

@ -215,10 +215,10 @@ namespace EShopOnAbp.IdentityService.DbMigrations
};
//Public Web Client
var publicWebClientRootUrl = _configuration["IdentityServerClients:EShopOnAbp_PublicWeb:RootUrl"]
var publicWebClientRootUrl = _configuration["IdentityServerClients:PublicWeb:RootUrl"]
.EnsureEndsWith('/');
await CreateClientAsync(
name: "EShopOnAbp_PublicWeb",
name: "PublicWeb",
scopes: commonScopes.Union(new[]
{
"AdministrationService"
@ -233,9 +233,9 @@ namespace EShopOnAbp.IdentityService.DbMigrations
//Angular Client
var angularClientRootUrl =
_configuration["IdentityServerClients:EShopOnAbp_Angular:RootUrl"].TrimEnd('/');
_configuration["IdentityServerClients:Web:RootUrl"].TrimEnd('/');
await CreateClientAsync(
name: "EShopOnAbp_Angular",
name: "Web",
scopes: commonScopes.Union(new[]
{
"IdentityService",

18
services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json

@ -42,18 +42,22 @@
"ElasticSearch": {
"Url": "http://localhost:9200"
},
"Consul": {
"Enabled": true,
"Host": "http://localhost:8500",
"Service": "Identity Service"
},
"IdentityServerClients": {
"EShopOnAbp_Angular": {
"Web": {
"RootUrl": "http://localhost:4200"
},
"EShopOnAbp_PublicWeb": {
"PublicWeb": {
"RootUrl": "https://localhost:44335/"
},
"InternalGateway": {
"RootUrl": "https://localhost:44371"
},
"WebGateway": {
"RootUrl": "https://localhost:44372"
},
"PublicWebGateway": {
"RootUrl": "https://localhost:44373"
},
"IdentityService": {
"RootUrl": "https://localhost:44351"
},

5
services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json

@ -40,10 +40,5 @@
},
"ElasticSearch": {
"Url": "http://localhost:9200"
},
"Consul": {
"Enabled": true,
"Host": "http://localhost:8500",
"Service": "Saas Service"
}
}

Loading…
Cancel
Save