From ec916668c5344edd9f456d9d32a3b912de55fd55 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 17:09:41 +0300 Subject: [PATCH 01/16] updated authserver sub-chart --- .../templates/authserver-deployment.yaml | 55 +++++++++++++++++++ .../templates/authserver-ingress.yaml | 12 ++-- .../authserver/templates/authserver.yaml | 34 ------------ .../eshoponabp/charts/authserver/values.yaml | 33 ++++++++--- etc/k8s/eshoponabp/values.yaml | 33 +++++++++++ 5 files changed, 120 insertions(+), 47 deletions(-) create mode 100644 etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml delete mode 100644 etc/k8s/eshoponabp/charts/authserver/templates/authserver.yaml diff --git a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml new file mode 100644 index 00000000..e69ae60d --- /dev/null +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml @@ -0,0 +1,55 @@ +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: App__RedirectAllowedUrls + value: "{{ .Values.config.allowedRedirectUrls }}" + - name: "ConnectionStrings__IdentityService" + value: {{ .Values.config.identityService.connString }} + - name: "ConnectionStrings__SaasService" + value: {{ .Values.config.saasService.connString }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.administrationService.connString }} + - name: "ConnectionStrings__SaasService" + value: {{ .Values.config.saasService.connString }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServerAuthority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServerRequireHttpsMetadata }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-ingress.yaml b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-ingress.yaml index affadc79..b74c1044 100644 --- a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-ingress.yaml +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-ingress.yaml @@ -3,21 +3,21 @@ kind: Ingress metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress annotations: - kubernetes.io/ingress.class: nginx + 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 }}" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" cert-manager.io/cluster-issuer: letsencrypt nginx.ingress.kubernetes.io/configuration-snippet: | more_set_input_headers "from-ingress: true"; spec: tls: - hosts: - - {{ .Values.global.authServer.domain }} - secretName: {{ .Values.global.tlsSecret }} + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} rules: - - host: "{{ .Values.global.authServer.domain }}" + - host: "{{ .Values.ingress.host }}" http: paths: - path: / diff --git a/etc/k8s/eshoponabp/charts/authserver/templates/authserver.yaml b/etc/k8s/eshoponabp/charts/authserver/templates/authserver.yaml deleted file mode 100644 index 80c14085..00000000 --- a/etc/k8s/eshoponabp/charts/authserver/templates/authserver.yaml +++ /dev/null @@ -1,34 +0,0 @@ -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.authServer.containerImage }}:{{ .Values.global.eshoponabpImageVersion }} - imagePullPolicy: {{ .Values.global.imagePullPolicy }} - name: {{ .Release.Name }}-{{ .Chart.Name }} - ports: - - name: http - containerPort: 80 - - name: https - containerPort: 443 - env: -{{ include "eshoponabp.global.env" . | indent 8 }} - - name: "ConnectionStrings__IdentityService" - value: {{ .Values.global.identityService.connString }} - - name: "ConnectionStrings__AdministrationService" - value: {{ .Values.global.administrationService.connString }} - - name: "ConnectionStrings__SaasService" - value: {{ .Values.global.saasService.connString }} - {{- if .Values.env }} -{{ toYaml .Values.env | indent 8 }} - {{- end }} - \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/authserver/values.yaml b/etc/k8s/eshoponabp/charts/authserver/values.yaml index 1f7d9b61..7ac6934f 100644 --- a/etc/k8s/eshoponabp/charts/authserver/values.yaml +++ b/etc/k8s/eshoponabp/charts/authserver/values.yaml @@ -1,8 +1,27 @@ - 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" +config: + selfUrl: # https://eshop-st-authserver + corsOrigins: # https://eshop-st-identity,https://eshop-st-administration,https://eshop-st-saas + allowedRedirectUrls: https://eshop-st-web + identityService: + connString: # + administrationService: + connString: # + saasService: + connString: # + dotnetEnv: # + redisHost: # + rabbitmqHost: # + elasticsearchHost: # + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: # eshop-st-authserver + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/app-authserver + 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 1498ad2c..ba36e563 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -86,6 +86,37 @@ tolerations: [] affinity: {} + + dotnetEnv: # + redisHost: # + rabbitmqHost: # + elasticsearchHost: # + authServerAuthority: # + authServerRequireHttpsMetadata: # + stringEncryptionDefaultPassPhrase: # + +# auth-server sub-chart override +authserver: + config: + selfUrl: https://eshop-st-authserver + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal + allowedRedirectUrls: https://eshop-st-web + identityService: + connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + administrationService: + connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + saasService: + connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + ingress: + host: eshop-st-authserver + image: + repository: "eshoponabp/app-authserver" + tag: latest + # sub-chart overrides administration: config: @@ -109,6 +140,8 @@ administration: repository: "eshoponabp/service-administration" tag: latest + + global: dotnetEnvironment: "Staging" imagePullPolicy: Never From 9d79e765b2f02cfcab9f2033094c5a714d77453a Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 18:09:52 +0300 Subject: [PATCH 02/16] updated identityservice sub-chart --- .../templates/identity-deployment.yaml | 72 +++++++++++++++++++ .../identity/templates/identity-ingress.yaml | 10 +-- .../charts/identity/templates/identity.yaml | 33 --------- .../eshoponabp/charts/identity/values.yaml | 56 +++++++++------ etc/k8s/eshoponabp/values.yaml | 31 ++++++++ 5 files changed, 143 insertions(+), 59 deletions(-) create mode 100644 etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml delete mode 100644 etc/k8s/eshoponabp/charts/identity/templates/identity.yaml diff --git a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml new file mode 100644 index 00000000..68e6679b --- /dev/null +++ b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml @@ -0,0 +1,72 @@ +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: RemoteServices__Default__BaseUrl + value: "{{ .Values.config.gatewayUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: IdentityClients__IdentityClients__Authority + value: "{{ .Values.config.identityClientAuthority }}" + - name: "ConnectionStrings__IdentityService" + value: {{ .Values.config.connString }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.administrationService.connString }} + - name: "ConnectionStrings__SaasService" + value: {{ .Values.config.saasService.connString }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServerAuthority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServerRequireHttpsMetadata }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "IdentityServerClients__Web__RootUrl" + value: {{ .Values.config.identityServerClients.webRootUrl }} + - name: "IdentityServerClients__PublicWeb__RootUrl" + value: {{ .Values.config.identityServerClients.publicWebRootUrl }} + - name: "IdentityServerClients__IdentityService__RootUrl" + value: {{ .Values.config.identityServerClients.identityServiceRootUrl }} + - name: "IdentityServerClients__SaasService__RootUrl" + value: {{ .Values.config.identityServerClients.saasServiceRootUrl }} + - name: "IdentityServerClients__AdministrationService__RootUrl" + value: {{ .Values.config.identityServerClients.administrationServiceRootUrl }} + - name: "IdentityServerClients__InternalGateway__RootUrl" + value: {{ .Values.config.identityServerClients.webRootUrl }} + - name: "IdentityServerClients__PublicWebGateway__RootUrl" + value: {{ .Values.config.identityServerClients.publicWebRootUrl }} + - name: "IdentityServerClients__WebGateway__RootUrl" + value: {{ .Values.config.identityServerClients.webGatewayRootUrl }} + + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/identity/templates/identity-ingress.yaml b/etc/k8s/eshoponabp/charts/identity/templates/identity-ingress.yaml index a51ad9f1..e843265f 100644 --- a/etc/k8s/eshoponabp/charts/identity/templates/identity-ingress.yaml +++ b/etc/k8s/eshoponabp/charts/identity/templates/identity-ingress.yaml @@ -6,16 +6,16 @@ metadata: 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 }}" + 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.global.identityService.domain }} - secretName: {{ .Values.global.tlsSecret }} + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} rules: - - host: "{{ .Values.global.identityService.domain }}" + - host: "{{ .Values.ingress.host }}" http: paths: - path: / diff --git a/etc/k8s/eshoponabp/charts/identity/templates/identity.yaml b/etc/k8s/eshoponabp/charts/identity/templates/identity.yaml deleted file mode 100644 index a34773ed..00000000 --- a/etc/k8s/eshoponabp/charts/identity/templates/identity.yaml +++ /dev/null @@ -1,33 +0,0 @@ -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.identityService.containerImage }}:{{ .Values.global.eshoponabpImageVersion }} - imagePullPolicy: {{ .Values.global.imagePullPolicy }} - name: {{ .Release.Name }}-{{ .Chart.Name }} - ports: - - name: http - containerPort: 80 - - name: https - containerPort: 443 - env: -{{ include "eshoponabp.global.env" . | indent 8 }} - - name: "ConnectionStrings__IdentityService" - value: {{ .Values.global.identityService.connString }} - - name: "ConnectionStrings__AdministrationService" - value: {{ .Values.global.administrationService.connString }} - - name: "ConnectionStrings__SaasService" - value: {{ .Values.global.saasService.connString }} - {{- 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 168e1bc5..bf61dbe4 100644 --- a/etc/k8s/eshoponabp/charts/identity/values.yaml +++ b/etc/k8s/eshoponabp/charts/identity/values.yaml @@ -1,22 +1,36 @@ - 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/" +config: + selfUrl: # https://eshop-st-identity + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal + identityClientAuthority: # https://eshop-st-authserver + connString: # + administrationService: + connString: # + saasService: + connString: # + dotnetEnv: # + redisHost: # + rabbitmqHost: # + elasticsearchHost: # + authServerAuthority: http://eshop-st-authserver + authServerRequireHttpsMetadata: "false" + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + identityServerClients: + webRootUrl: # + publicWebRootUrl: # + webGatewayRootUrl: # + publicWebGatewayRootUrl: # + identityServiceRootUrl: # + administrationServiceRootUrl: # + saasServiceRootUrl: # + +ingress: + host: # eshop-st-identity + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-identity + 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 ba36e563..b5b087f2 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -117,6 +117,37 @@ authserver: repository: "eshoponabp/app-authserver" tag: latest +# identity-service sub-chart override +identity: + config: + selfUrl: https://eshop-st-identity + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal + connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + administrationService: + connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + saasService: + connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + authServerAuthority: http://eshop-st-authserver + authServerRequireHttpsMetadata: "false" + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + identityServerClients: + webRootUrl: https://eshop-st-web/ + publicWebRootUrl: https://eshop-st-public-web/ + webGatewayRootUrl: https://eshop-st-gateway-web/ + publicWebGatewayRootUrl: https://eshop-st-gateway-public-web/ + identityServiceRootUrl: https://eshop-st-identity/ + administrationServiceRootUrl: https://eshop-st-administration/ + saasServiceRootUrl: https://eshop-st-saas/ + ingress: + host: eshop-st-identity + image: + repository: "eshoponabp/app-identity" + tag: latest + # sub-chart overrides administration: config: From d44693c0872cb6a111d8239633b9e78c899c8e16 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 19:52:59 +0300 Subject: [PATCH 03/16] refactored gateway-public-web -> gateway-web-public --- etc/k8s/README.md | 2 +- .../charts/gateway-public-web/Chart.yaml | 6 --- .../templates/gateway-public-web.yaml | 35 ------------- .../charts/gateway-public-web/values.yaml | 6 --- .../charts/gateway-web-public/Chart.yaml | 6 +++ .../gateway-web-public-configmap.yaml} | 0 .../gateway-web-public-deployment.yaml | 52 +++++++++++++++++++ .../gateway-web-public-ingress.yaml} | 18 +++---- .../gateway-web-public-service.yaml} | 0 .../charts/gateway-web-public/values.yaml | 23 ++++++++ etc/k8s/eshoponabp/values.yaml | 36 ++++++++----- etc/scripts/build-images.ps1 | 10 ++-- 12 files changed, 118 insertions(+), 76 deletions(-) delete mode 100644 etc/k8s/eshoponabp/charts/gateway-public-web/Chart.yaml delete mode 100644 etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web.yaml delete mode 100644 etc/k8s/eshoponabp/charts/gateway-public-web/values.yaml create mode 100644 etc/k8s/eshoponabp/charts/gateway-web-public/Chart.yaml rename etc/k8s/eshoponabp/charts/{gateway-public-web/templates/gateway-public-web-configmap.yaml => gateway-web-public/templates/gateway-web-public-configmap.yaml} (100%) create mode 100644 etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml rename etc/k8s/eshoponabp/charts/{gateway-public-web/templates/gateway-public-web-ingress.yaml => gateway-web-public/templates/gateway-web-public-ingress.yaml} (55%) rename etc/k8s/eshoponabp/charts/{gateway-public-web/templates/gateway-public-web-service.yaml => gateway-web-public/templates/gateway-web-public-service.yaml} (100%) create mode 100644 etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml diff --git a/etc/k8s/README.md b/etc/k8s/README.md index 96bc32bf..a33c2ab8 100644 --- a/etc/k8s/README.md +++ b/etc/k8s/README.md @@ -25,7 +25,7 @@ helm install ingress-nginx ingress-nginx/ingress-nginx 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-web-public 127.0.0.1 eshop-st-gateway-internal ```` diff --git a/etc/k8s/eshoponabp/charts/gateway-public-web/Chart.yaml b/etc/k8s/eshoponabp/charts/gateway-public-web/Chart.yaml deleted file mode 100644 index e80e736d..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-public-web/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -name: gateway-public-web -appVersion: "1.0" -description: eShopOnAbp Public Web Gateway Application -version: 1.0.0 -type: application diff --git a/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web.yaml b/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web.yaml deleted file mode 100644 index 7a67f44d..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web.yaml +++ /dev/null @@ -1,35 +0,0 @@ -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/appsettings.json - subPath: appsettings.json - 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 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-public-web/values.yaml b/etc/k8s/eshoponabp/charts/gateway-public-web/values.yaml deleted file mode 100644 index 9ebf0117..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-public-web/values.yaml +++ /dev/null @@ -1,6 +0,0 @@ - env: - - name: "App__SelfUrl" - value: "https://eshop-st-gateway-public-web" - - name: "GlobalConfiguration__BaseUrl" - value: "http://eshop-st-gateway-public-web" - \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/Chart.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/Chart.yaml new file mode 100644 index 00000000..50b051d8 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: gateway-web-public +appVersion: "1.0" +description: eShopOnAbp Web Public Gateway Application +version: 1.0.0 +type: application diff --git a/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-configmap.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml similarity index 100% rename from etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-configmap.yaml rename to etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-configmap.yaml 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 new file mode 100644 index 00000000..a64d660e --- /dev/null +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-deployment.yaml @@ -0,0 +1,52 @@ +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 + volumeMounts: + - name: config-volume + mountPath: /app/appsettings.json + subPath: appsettings.json + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: GlobalConfiguration__BaseUrl + value: "{{ .Values.config.globalConfigurationBaseUrl }}" + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + volumes: + - name: config-volume + configMap: + name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-ingress.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-ingress.yaml similarity index 55% rename from etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-ingress.yaml rename to etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-ingress.yaml index 5e887ccf..539025ac 100644 --- a/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-ingress.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-ingress.yaml @@ -3,28 +3,28 @@ kind: Ingress metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress annotations: - kubernetes.io/ingress.class: nginx + 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 }}" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt {{- 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 }} + - {{ .Values.ingress.host }} {{- if eq .Release.Name "es-az" }} - - {{ print "www." .Values.global.gatewayPublicWeb.domain }} + - {{ print "www." .Values.global.ingress.host }} {{- end }} - secretName: {{ .Values.global.tlsSecret }} + secretName: {{ .Values.ingress.tlsSecret }} rules: {{- if eq .Release.Name "es-az" }} - - host: "{{ print "www." .Values.global.gatewayPublicWeb.domain }}" + - host: "{{ print "www." .Values.ingress.host }}" {{- else }} - - host: "{{ .Values.global.gatewayPublicWeb.domain }}" + - host: "{{ .Values.ingress.host }}" {{- end }} http: paths: diff --git a/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-service.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-service.yaml similarity index 100% rename from etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-service.yaml rename to etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-service.yaml diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml new file mode 100644 index 00000000..925d07b9 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml @@ -0,0 +1,23 @@ +config: + selfUrl: # https://eshop-st-gateway-public-web + globalConfigurationBaseUrl: # http://eshop-st-gateway-public-web + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + dotnetEnv: # + redisHost: # + rabbitmqHost: # + elasticsearchHost: # + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: # eshop-st-gateway-public-web + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/gateway-web-public + 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 b5b087f2..cb81e3a4 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -86,20 +86,11 @@ tolerations: [] affinity: {} - - dotnetEnv: # - redisHost: # - rabbitmqHost: # - elasticsearchHost: # - authServerAuthority: # - authServerRequireHttpsMetadata: # - stringEncryptionDefaultPassPhrase: # - # auth-server sub-chart override authserver: config: selfUrl: https://eshop-st-authserver - corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-gateway-internal allowedRedirectUrls: https://eshop-st-web identityService: connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" @@ -121,7 +112,7 @@ authserver: identity: config: selfUrl: https://eshop-st-identity - corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-gateway-internal connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" administrationService: connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" @@ -138,7 +129,7 @@ identity: webRootUrl: https://eshop-st-web/ publicWebRootUrl: https://eshop-st-public-web/ webGatewayRootUrl: https://eshop-st-gateway-web/ - publicWebGatewayRootUrl: https://eshop-st-gateway-public-web/ + publicWebGatewayRootUrl: https://eshop-st-gateway-web-public/ identityServiceRootUrl: https://eshop-st-identity/ administrationServiceRootUrl: https://eshop-st-administration/ saasServiceRootUrl: https://eshop-st-saas/ @@ -153,7 +144,7 @@ administration: 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 + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-gateway-internal identityClientAuthority: https://eshop-st-authserver connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" saasService: @@ -171,7 +162,24 @@ administration: repository: "eshoponabp/service-administration" tag: latest - +# gateway-web-public sub-chart override +gateway-web-public: + config: + selfUrl: https://eshop-st-gateway-web-public + globalConfigurationBaseUrl: http://eshop-st-gateway-public-web + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + ingress: + host: eshop-st-gateway-web-public + image: + repository: "eshoponabp/gateway-web-public" + tag: latest global: dotnetEnvironment: "Staging" diff --git a/etc/scripts/build-images.ps1 b/etc/scripts/build-images.ps1 index 2118c03c..592bef60 100644 --- a/etc/scripts/build-images.ps1 +++ b/etc/scripts/build-images.ps1 @@ -7,7 +7,7 @@ $authserverFolder = Join-Path $slnFolder "apps/auth-server/src/EShopOnAbp.AuthSe $publicWebFolder = Join-Path $slnFolder "apps/public-web/src/EShopOnAbp.PublicWeb" $webGatewayFolder = Join-Path $slnFolder "gateways/web/src/EShopOnAbp.WebGateway" -$publicWebGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnAbp.WebPublicGateway" +$webPublicGatewayFolder = Join-Path $slnFolder "gateways/web-public/src/EShopOnAbp.WebPublicGateway" $internalGatewayFolder = Join-Path $slnFolder "gateways/internal/src/EShopOnAbp.InternalGateway" $identityServiceFolder = Join-Path $slnFolder "services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host" @@ -29,7 +29,7 @@ dotnet publish -c Release docker build -t eshoponabp/app-authserver:$version . ### PUBLIC-WEB -Write-Host "*** BUILDING PUBLIC-WEB ****************" -ForegroundColor Green +Write-Host "*** BUILDING WEB-PUBLIC ****************" -ForegroundColor Green Set-Location $publicWebFolder dotnet publish -c Release docker build -t eshoponabp/app-publicweb:$version . @@ -41,10 +41,10 @@ dotnet publish -c Release docker build -t eshoponabp/gateway-web:$version . ### PUBLICWEB-GATEWAY -Write-Host "*** BUILDING PUBLICWEB-GATEWAY ****************" -ForegroundColor Green -Set-Location $publicWebGatewayFolder +Write-Host "*** BUILDING WEB-PUBLIC-GATEWAY ****************" -ForegroundColor Green +Set-Location $webPublicGatewayFolder dotnet publish -c Release -docker build -t eshoponabp/gateway-publicweb:$version . +docker build -t eshoponabp/gateway-web-public:$version . ### INTERNAL-GATEWAY Write-Host "*** BUILDING INTERNAL-GATEWAY ****************" -ForegroundColor Green From 28cd6cbfc672f6e58f2ec05cd6813591e2fb2fe9 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 20:35:46 +0300 Subject: [PATCH 04/16] gateway-web chart updated --- .../templates/gateway-web-configmap.yaml | 42 +++++------ .../templates/gateway-web-deployment.yaml | 51 +++++++++++++ .../templates/gateway-web-ingress.yaml | 18 ++--- .../gateway-web/templates/gateway-web.yaml | 34 --------- .../eshoponabp/charts/gateway-web/values.yaml | 71 +++++++++---------- etc/k8s/eshoponabp/values.yaml | 33 ++++++++- 6 files changed, 147 insertions(+), 102 deletions(-) create mode 100644 etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml delete mode 100644 etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web.yaml diff --git a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml index 48931b6c..80b4cb7c 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-configmap.yaml @@ -9,11 +9,11 @@ data: { "ServiceKey": "Identity Service", "DownstreamPathTemplate": "/api/identity/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.identityService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-identity", - "Port": 80 + "Host": "{{ .Values.reRoutes.identityService.host }}", + "Port": {{ .Values.reRoutes.identityService.port }} } ], "UpstreamPathTemplate": "/api/identity/{everything}", @@ -22,11 +22,11 @@ data: { "ServiceKey": "Identity Service", "DownstreamPathTemplate": "/api/account/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.identityService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-identity", - "Port": 80 + "Host": "{{ .Values.reRoutes.identityService.host }}", + "Port": {{ .Values.reRoutes.identityService.port }} } ], "UpstreamPathTemplate": "/api/account/{everything}", @@ -35,11 +35,11 @@ data: { "ServiceKey": "Saas Service", "DownstreamPathTemplate": "/api/saas/{everything}", - "DownstreamScheme": "https", + "DownstreamScheme": "{{ .Values.reRoutes.saasService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-saas", - "Port": 80 + "Host": "{{ .Values.reRoutes.saasService.host }}", + "Port": {{ .Values.reRoutes.saasService.port }} } ], "UpstreamPathTemplate": "/api/saas/{everything}", @@ -48,11 +48,11 @@ data: { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/abp/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.administrationService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-administration", - "Port": 80 + "Host": "{{ .Values.reRoutes.administrationService.host }}", + "Port": "{{ .Values.reRoutes.administrationService.port }}", } ], "UpstreamPathTemplate": "/api/abp/{everything}", @@ -61,11 +61,11 @@ data: { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/feature-management/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.administrationService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-administration", - "Port": 80 + "Host": "{{ .Values.reRoutes.administrationService.host }}", + "Port": "{{ .Values.reRoutes.administrationService.port }}", } ], "UpstreamPathTemplate": "/api/feature-management/{everything}", @@ -74,11 +74,11 @@ data: { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/permission-management/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.administrationService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-administration", - "Port": 80 + "Host": "{{ .Values.reRoutes.administrationService.host }}", + "Port": "{{ .Values.reRoutes.administrationService.port }}", } ], "UpstreamPathTemplate": "/api/permission-management/{everything}", @@ -87,11 +87,11 @@ data: { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/setting-management/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.administrationService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-administration", - "Port": 80 + "Host": "{{ .Values.reRoutes.administrationService.host }}", + "Port": "{{ .Values.reRoutes.administrationService.port }}", } ], "UpstreamPathTemplate": "/api/setting-management/{everything}", 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 new file mode 100644 index 00000000..bcda37ff --- /dev/null +++ b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-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 + volumeMounts: + - name: config-volume + mountPath: /app/appsettings.json + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: GlobalConfiguration__BaseUrl + value: "{{ .Values.config.globalConfigurationBaseUrl }}" + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + volumes: + - name: config-volume + configMap: + name: {{ .Release.Name }}-{{ .Chart.Name }}-configmap \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-ingress.yaml b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-ingress.yaml index f7199f59..8e106909 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-ingress.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-ingress.yaml @@ -3,28 +3,28 @@ kind: Ingress metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress annotations: - kubernetes.io/ingress.class: nginx + 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 }}" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt {{- 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 }} + - {{ .Values.ingress.host }} {{- if eq .Release.Name "es-az" }} - - {{ print "www." .Values.global.gatewayWeb.domain }} + - {{ print "www." .Values.ingress.host }} {{- end }} - secretName: {{ .Values.global.tlsSecret }} + secretName: {{ .Values.ingress.tlsSecret }} rules: {{- if eq .Release.Name "es-az" }} - - host: "{{ print "www." .Values.global.gatewayWeb.domain }}" + - host: "{{ print "www." .Values.ingress.host }}" {{- else }} - - host: "{{ .Values.global.gatewayWeb.domain }}" + - host: "{{ .Values.ingress.host }}" {{- end }} http: paths: diff --git a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web.yaml b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web.yaml deleted file mode 100644 index 47d90710..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web.yaml +++ /dev/null @@ -1,34 +0,0 @@ -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 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml index d9e1898b..ec5ff94f 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml @@ -1,37 +1,34 @@ - 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" \ No newline at end of file +config: + selfUrl: # https://eshop-st-gateway-web + globalConfigurationBaseUrl: # http://eshop-st-gateway-web + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + dotnetEnv: # + redisHost: # + rabbitmqHost: # + elasticsearchHost: # + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 +reRoutes: + identityService: + schema: http + host: eshop-st-identity + port: 80 + administrationService: + schema: http + host: eshop-st-administration + port: 80 + saasService: + schema: # http + host: # eshop-st-saas + port: # 80 +ingress: + host: # eshop-st-gateway-web + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/gateway-web + 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 cb81e3a4..2438c68a 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -162,13 +162,44 @@ administration: repository: "eshoponabp/service-administration" tag: latest +# gateway-web sub-chart override +gateway-web: + config: + selfUrl: https://eshop-st-gateway-web + globalConfigurationBaseUrl: http://eshop-st-gateway-public + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + ingress: + host: eshop-st-gateway-web + image: + repository: "eshoponabp/gateway-web" + tag: latest + reRoutes: + identityService: + schema: http + host: eshop-st-identity + port: 80 + administrationService: + schema: http + host: eshop-st-administration + port: 80 + saasService: + schema: http + host: eshop-st-saas + port: 80 # gateway-web-public sub-chart override gateway-web-public: config: 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" dotnetEnv: Staging redisHost: es-st-redis From 8d09213a786ed57ed8b17cf33ed235c702d74cf3 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 20:54:17 +0300 Subject: [PATCH 05/16] updated public-web application sub chart --- .../templates/public-web-deployment.yaml | 44 +++++++++++++++++++ .../templates/public-web-ingress.yaml | 24 +++++----- .../public-web/templates/public-web.yaml | 31 ------------- .../eshoponabp/charts/public-web/values.yaml | 23 +++++++++- etc/k8s/eshoponabp/values.yaml | 18 ++++++++ 5 files changed, 95 insertions(+), 45 deletions(-) create mode 100644 etc/k8s/eshoponabp/charts/public-web/templates/public-web-deployment.yaml delete mode 100644 etc/k8s/eshoponabp/charts/public-web/templates/public-web.yaml diff --git a/etc/k8s/eshoponabp/charts/public-web/templates/public-web-deployment.yaml b/etc/k8s/eshoponabp/charts/public-web/templates/public-web-deployment.yaml new file mode 100644 index 00000000..fd3201e5 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/public-web/templates/public-web-deployment.yaml @@ -0,0 +1,44 @@ +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: RemoteServices__Default__BaseUrl + value: {{ .Values.config.gatewayUrl}} + - name: "AuthServer__Authority" + value: {{ .Values.config.authServer.authority }} + - name: "AuthServer__RequireHttpsMetadata" + value: {{ .Values.config.authServer.requireHttpsMetadata }} + - name: "DOTNET_ENVIRONMENT" + value: {{ .Values.config.dotnetEnv }} + - name: "Redis__Configuration" + value: {{ .Values.config.redisHost }} + - name: "StringEncryption__DefaultPassPhrase" + value: {{ .Values.config.stringEncryptionDefaultPassPhrase }} + - name: "RabbitMQ__Connections__Default__HostName" + value: {{ .Values.config.rabbitmqHost }} + - name: "ElasticSearch__Url" + value: {{ .Values.config.elasticsearchHost }} + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/public-web/templates/public-web-ingress.yaml b/etc/k8s/eshoponabp/charts/public-web/templates/public-web-ingress.yaml index 9647d7d1..ec4080bc 100644 --- a/etc/k8s/eshoponabp/charts/public-web/templates/public-web-ingress.yaml +++ b/etc/k8s/eshoponabp/charts/public-web/templates/public-web-ingress.yaml @@ -3,28 +3,28 @@ kind: Ingress metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress annotations: - kubernetes.io/ingress.class: nginx + 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 "eh-az" }} + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +{{- 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.publicWeb.domain }} -{{- if eq .Release.Name "eh-az" }} - - {{ print "www." .Values.global.publicWeb.domain }} + - {{ .Values.ingress.host }} +{{- if eq .Release.Name "es-az" }} + - {{ print "www." .Values.ingress.host }} {{- end }} - secretName: {{ .Values.global.tlsSecret }} + secretName: {{ .Values.ingress.tlsSecret }} rules: -{{- if eq .Release.Name "eh-az" }} - - host: "{{ print "www." .Values.global.publicWeb.domain }}" +{{- if eq .Release.Name "es-az" }} + - host: "{{ print "www." .Values.ingress.host }}" {{- else }} - - host: "{{ .Values.global.publicWeb.domain }}" + - host: "{{ .Values.ingress.host }}" {{- end }} http: paths: diff --git a/etc/k8s/eshoponabp/charts/public-web/templates/public-web.yaml b/etc/k8s/eshoponabp/charts/public-web/templates/public-web.yaml deleted file mode 100644 index b10f35c6..00000000 --- a/etc/k8s/eshoponabp/charts/public-web/templates/public-web.yaml +++ /dev/null @@ -1,31 +0,0 @@ -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.publicWeb.containerImage }}:{{ .Values.global.eshoponabpImageVersion }} - imagePullPolicy: {{ .Values.global.imagePullPolicy }} - name: {{ .Release.Name }}-{{ .Chart.Name }} - ports: - - name: http - containerPort: 80 - - name: https - containerPort: 443 - env: - - name: App__SelfUrl - value: {{ .Values.config.selfUrl}} - - name: RemoteServices__Default__BaseUrl - value: {{ .Values.config.gatewayUrl}} -{{ include "eshoponabp.global.env" . | indent 8 }} - {{- if .Values.env }} -{{ toYaml .Values.env | indent 8 }} - {{- end }} \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/public-web/values.yaml b/etc/k8s/eshoponabp/charts/public-web/values.yaml index 32ea0c1a..72542a20 100644 --- a/etc/k8s/eshoponabp/charts/public-web/values.yaml +++ b/etc/k8s/eshoponabp/charts/public-web/values.yaml @@ -1,3 +1,22 @@ config: - selfUrl: "https://eshop-st-public-web" - gatewayUrl: "http://eshop-st-gateway-public-web/" + selfUrl: https://eshop-st-public-web + gatewayUrl: "http://eshop-st-gateway-web-public/" + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: # eshop-st-public-web + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/app-publicweb + tag: latest + pullPolicy: IfNotPresent + +env: {} diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 2438c68a..b8f4366a 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -108,6 +108,24 @@ authserver: repository: "eshoponabp/app-authserver" tag: latest +# public-web sub-chart override +public-web: + config: + selfUrl: https://eshop-st-public-web + gatewayUrl: "http://eshop-st-gateway-web-public/" + authServer: + authority: http://eshop-st-AUTHSERVER + requireHttpsMetadata: "false" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + ingress: + host: eshop-st-public-web + image: + repository: "eshoponabp/app-publicweb" + tag: latest + # identity-service sub-chart override identity: config: From 2213ed80919d6a59635ab4599c3440f2acb2c752 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 21:04:05 +0300 Subject: [PATCH 06/16] updated web app sub chart --- .../{web.yaml => web-deployment.yaml} | 11 +++++---- .../charts/web/templates/web-ingress.yaml | 24 +++++++++---------- etc/k8s/eshoponabp/charts/web/values.yaml | 18 +++++++++++--- etc/k8s/eshoponabp/values.yaml | 11 +++++++++ 4 files changed, 45 insertions(+), 19 deletions(-) rename etc/k8s/eshoponabp/charts/web/templates/{web.yaml => web-deployment.yaml} (60%) diff --git a/etc/k8s/eshoponabp/charts/web/templates/web.yaml b/etc/k8s/eshoponabp/charts/web/templates/web-deployment.yaml similarity index 60% rename from etc/k8s/eshoponabp/charts/web/templates/web.yaml rename to etc/k8s/eshoponabp/charts/web/templates/web-deployment.yaml index da0d1103..cbe7b699 100644 --- a/etc/k8s/eshoponabp/charts/web/templates/web.yaml +++ b/etc/k8s/eshoponabp/charts/web/templates/web-deployment.yaml @@ -12,8 +12,8 @@ spec: app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers: - - image: {{ .Values.global.web.containerImage }}:{{ .Values.global.eshoponabpImageVersion }} - imagePullPolicy: {{ .Values.global.imagePullPolicy }} + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} name: {{ .Release.Name }}-{{ .Chart.Name }} ports: - name: http @@ -21,7 +21,10 @@ spec: - name: https containerPort: 443 env: -{{ include "eshoponabp.global.env" . | indent 8 }} - {{- if .Values.env }} + - name: BASE_URL + value: {{ .Values.config.selfUrl}} + - name: API_URL + value: {{ .Values.config.gatewayUrl}} + {{- if .Values.env }} {{ toYaml .Values.env | indent 8 }} {{- end }} \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/web/templates/web-ingress.yaml b/etc/k8s/eshoponabp/charts/web/templates/web-ingress.yaml index a463a88d..54a62c3c 100644 --- a/etc/k8s/eshoponabp/charts/web/templates/web-ingress.yaml +++ b/etc/k8s/eshoponabp/charts/web/templates/web-ingress.yaml @@ -3,28 +3,28 @@ kind: Ingress metadata: name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress annotations: - kubernetes.io/ingress.class: nginx + 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 "eh-az" }} + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +{{- 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.web.domain }} -{{- if eq .Release.Name "eh-az" }} - - {{ print "www." .Values.global.web.domain }} + - {{ .Values.ingress.host }} +{{- if eq .Release.Name "eh-es" }} + - {{ print "www." .Values.ingress.host }} {{- end }} - secretName: {{ .Values.global.tlsSecret }} + secretName: {{ .Values.ingress.tlsSecret }} rules: -{{- if eq .Release.Name "eh-az" }} - - host: "{{ print "www." .Values.global.web.domain }}" +{{- if eq .Release.Name "eh-es" }} + - host: "{{ print "www." .Values.ingress.host }}" {{- else }} - - host: "{{ .Values.global.web.domain }}" + - host: "{{ .Values.ingress.host }}" {{- end }} http: paths: diff --git a/etc/k8s/eshoponabp/charts/web/values.yaml b/etc/k8s/eshoponabp/charts/web/values.yaml index d09efec5..db30b07e 100644 --- a/etc/k8s/eshoponabp/charts/web/values.yaml +++ b/etc/k8s/eshoponabp/charts/web/values.yaml @@ -1,3 +1,15 @@ - env: - - name: "BASE_URL" - value: "https://eshop-st-web" \ No newline at end of file +config: + selfUrl: https://eshop-st-web + gatewayUrl: "https://eshop-st-gateway-web/" + +ingress: + host: eshop-st-web + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/app-web + tag: latest + pullPolicy: IfNotPresent + +# Extra environment variables or configurations +env: {} diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index b8f4366a..9979f6f8 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -108,6 +108,17 @@ authserver: repository: "eshoponabp/app-authserver" tag: latest +# web sub-chart override +web: + config: + selfUrl: https://eshop-st-web + gatewayUrl: "https://eshop-st-gateway-web/" + ingress: + host: eshop-st-web + image: + repository: "eshoponabp/app-web" + tag: latest + # public-web sub-chart override public-web: config: From 1cd33619c9ad0a7a27804c17f86dbf964dbd9cee Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 21:16:41 +0300 Subject: [PATCH 07/16] updated gateway-web-public configmap --- .../gateway-web-public-configmap.yaml | 30 ++++---- .../charts/gateway-web-public/values.yaml | 34 +++++++-- etc/k8s/eshoponabp/values.yaml | 74 ++++++------------- 3 files changed, 64 insertions(+), 74 deletions(-) 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 fe62f397..88f4794e 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 @@ -9,11 +9,11 @@ data: { "ServiceKey": "Identity Service", "DownstreamPathTemplate": "/api/account/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.identityService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-identity", - "Port": 80 + "Host": "{{ .Values.reRoutes.identityService.host }}", + "Port": {{ .Values.reRoutes.identityService.port }} } ], "UpstreamPathTemplate": "/api/account/{everything}", @@ -22,11 +22,11 @@ data: { "ServiceKey": "Administration Service", "DownstreamPathTemplate": "/api/abp/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.administrationService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-administration", - "Port": 80 + "Host": "{{ .Values.reRoutes.administrationService.host }}", + "Port": "{{ .Values.reRoutes.administrationService.port }}", } ], "UpstreamPathTemplate": "/api/abp/{everything}", @@ -35,11 +35,11 @@ data: { "ServiceKey": "Catalog Service", "DownstreamPathTemplate": "/api/catalog/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.catalogService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-catalog", - "Port": 80 + "Host": "{{ .Values.reRoutes.catalogService.host }}", + "Port": "{{ .Values.reRoutes.catalogService.port }}", } ], "UpstreamPathTemplate": "/api/catalog/{everything}", @@ -48,11 +48,11 @@ data: { "ServiceKey": "Basket Service", "DownstreamPathTemplate": "/api/basket/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.basketService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-basket", - "Port": 80 + "Host": "{{ .Values.reRoutes.basketService.host }}", + "Port": "{{ .Values.reRoutes.basketService.port }}", } ], "UpstreamPathTemplate": "/api/basket/{everything}", @@ -61,11 +61,11 @@ data: { "ServiceKey": "Ordering Service", "DownstreamPathTemplate": "/api/ordering/{everything}", - "DownstreamScheme": "http", + "DownstreamScheme": "{{ .Values.reRoutes.orderService.schema }}", "DownstreamHostAndPorts": [ { - "Host": "eshop-st-ordering", - "Port": 80 + "Host": "{{ .Values.reRoutes.orderService.host }}", + "Port": "{{ .Values.reRoutes.orderService.port }}", } ], "UpstreamPathTemplate": "/api/ordering/{everything}", diff --git a/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml index 925d07b9..321eeaca 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml @@ -1,17 +1,39 @@ config: - selfUrl: # https://eshop-st-gateway-public-web - globalConfigurationBaseUrl: # http://eshop-st-gateway-public-web + selfUrl: https://eshop-st-gateway-public-web + globalConfigurationBaseUrl: http://eshop-st-gateway-public-web authServer: authority: http://eshop-st-authserver requireHttpsMetadata: "false" - dotnetEnv: # - redisHost: # - rabbitmqHost: # + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq elasticsearchHost: # stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 +reRoutes: + identityService: + schema: http + host: eshop-st-identity + port: 80 + administrationService: + schema: http + host: eshop-st-administration + port: 80 + catalogService: + schema: http + host: eshop-st-catalog + port: 80 + basketService: + schema: http + host: eshop-st-basket + port: 80 + orderService: + schema: http + host: eshop-st-order + port: 80 + ingress: - host: # eshop-st-gateway-public-web + host: eshop-st-gateway-web-public tlsSecret: eshop-demo-tls image: diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 9979f6f8..a8e540f4 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -240,56 +240,24 @@ gateway-web-public: image: repository: "eshoponabp/gateway-web-public" tag: latest - -global: - dotnetEnvironment: "Staging" - imagePullPolicy: Never - eshoponabpImageVersion: latest - tlsSecret: eshop-demo-tls - web: - domain: eshop-st-web - url: https://eshop-st-web - containerImage: "eshoponabp/app-web" - publicWeb: - domain: eshop-st-public-web - url: https://eshop-st-public-web - containerImage: "eshoponabp/app-publicweb" - authServer: - domain: eshop-st-authserver - url: https://eshop-st-authserver - containerImage: "eshoponabp/app-authserver" - identityService: - domain: eshop-st-identity - url: https://eshop-st-identity - containerImage: "eshoponabp/service-identity" - connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" - administrationService: - domain: eshop-st-administration - url: https://eshop-st-administration - containerImage: "eshoponabp/service-administration" - connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" - saasService: - domain: eshop-st-saas - url: https://eshop-st-saas - containerImage: "eshoponabp/service-saas" - 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" - 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://eshop-st-authserver" - internalAuthServerRequireHttpsMetadata: "false" - stringEncryptionDefaultPassPhrase: "gsKnGZ041HLL4IM8" \ No newline at end of file + reRoutes: + identityService: + schema: http + host: eshop-st-identity + port: 80 + administrationService: + schema: http + host: eshop-st-administration + port: 80 + catalogService: + schema: http + host: eshop-st-catalog + port: 80 + basketService: + schema: http + host: eshop-st-basket + port: 80 + orderService: + schema: http + host: eshop-st-order + port: 80 From ba7128fab23c2c6aecc9dc0c89f89ef462754fd8 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 21:56:57 +0300 Subject: [PATCH 08/16] removed internal gateway chart --- .../charts/gateway-internal/Chart.yaml | 6 - .../templates/gateway-internal-configmap.yaml | 113 ------------------ .../templates/gateway-internal-ingress.yaml | 37 ------ .../templates/gateway-internal-service.yaml | 14 --- .../templates/gateway-internal.yaml | 34 ------ .../charts/gateway-internal/values.yaml | 35 ------ 6 files changed, 239 deletions(-) delete mode 100644 etc/k8s/eshoponabp/charts/gateway-internal/Chart.yaml delete mode 100644 etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-configmap.yaml delete mode 100644 etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-ingress.yaml delete mode 100644 etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-service.yaml delete mode 100644 etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal.yaml delete mode 100644 etc/k8s/eshoponabp/charts/gateway-internal/values.yaml diff --git a/etc/k8s/eshoponabp/charts/gateway-internal/Chart.yaml b/etc/k8s/eshoponabp/charts/gateway-internal/Chart.yaml deleted file mode 100644 index 473c97b8..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-internal/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -name: gateway-internal -appVersion: "1.0" -description: eShopOnAbp Internal Web Gateway Application -version: 1.0.0 -type: application diff --git a/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-configmap.yaml b/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-configmap.yaml deleted file mode 100644 index 815bb151..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-configmap.yaml +++ /dev/null @@ -1,113 +0,0 @@ -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" ] - }] - } \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-ingress.yaml b/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-ingress.yaml deleted file mode 100644 index 8af97019..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-ingress.yaml +++ /dev/null @@ -1,37 +0,0 @@ -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: {{ .Values.global.tlsSecret }} - 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 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-service.yaml b/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-service.yaml deleted file mode 100644 index ee157c01..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -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/gateway-internal/templates/gateway-internal.yaml b/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal.yaml deleted file mode 100644 index 9e81e9a9..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal.yaml +++ /dev/null @@ -1,34 +0,0 @@ -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 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-internal/values.yaml b/etc/k8s/eshoponabp/charts/gateway-internal/values.yaml deleted file mode 100644 index 343d766e..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-internal/values.yaml +++ /dev/null @@ -1,35 +0,0 @@ - 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" \ No newline at end of file From 0eefef9bb77aeae6e7b52ab83b329ba4eb639701 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 21:57:20 +0300 Subject: [PATCH 09/16] updated saas and identity chart values --- .../templates/identity-deployment.yaml | 41 ++++++++---------- .../eshoponabp/charts/identity/values.yaml | 43 ++++++++++--------- .../charts/saas/templates/saas-ingress.yaml | 10 ++--- .../charts/saas/templates/saas.yaml | 27 +++++++++--- etc/k8s/eshoponabp/charts/saas/values.yaml | 31 ++++++++++--- etc/k8s/eshoponabp/values.yaml | 37 ++++++++-------- 6 files changed, 110 insertions(+), 79 deletions(-) diff --git a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml index 68e6679b..072eb431 100644 --- a/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml @@ -23,49 +23,44 @@ spec: env: - name: App__SelfUrl value: "{{ .Values.config.selfUrl }}" - - name: RemoteServices__Default__BaseUrl - value: "{{ .Values.config.gatewayUrl }}" - name: App__CorsOrigins value: "{{ .Values.config.corsOrigins }}" - - name: IdentityClients__IdentityClients__Authority - value: "{{ .Values.config.identityClientAuthority }}" - name: "ConnectionStrings__IdentityService" - value: {{ .Values.config.connString }} + value: {{ .Values.config.connectionStrings.identityService }} - name: "ConnectionStrings__AdministrationService" - value: {{ .Values.config.administrationService.connString }} + value: {{ .Values.config.connectionStrings.administrationService }} - name: "ConnectionStrings__SaasService" - value: {{ .Values.config.saasService.connString }} + value: {{ .Values.config.connectionStrings.saasService }} - name: "DOTNET_ENVIRONMENT" value: "{{ .Values.config.dotnetEnv }}" - name: "Redis__Configuration" value: "{{ .Values.config.redisHost }}" - - name: "AuthServer__Authority" - value: "{{ .Values.config.authServerAuthority }}" - - name: "AuthServer__RequireHttpsMetadata" - value: "{{ .Values.config.authServerRequireHttpsMetadata }}" - - name: "StringEncryption__DefaultPassPhrase" - value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" - name: "RabbitMQ__Connections__Default__HostName" value: "{{ .Values.config.rabbitmqHost }}" - name: "ElasticSearch__Url" - value: "{{ .Values.config.elasticsearchHost }}" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" - name: "IdentityServerClients__Web__RootUrl" - value: {{ .Values.config.identityServerClients.webRootUrl }} + value: {{ .Values.identityServerClients.webRootUrl }} - name: "IdentityServerClients__PublicWeb__RootUrl" - value: {{ .Values.config.identityServerClients.publicWebRootUrl }} + value: {{ .Values.identityServerClients.publicWebRootUrl }} - name: "IdentityServerClients__IdentityService__RootUrl" - value: {{ .Values.config.identityServerClients.identityServiceRootUrl }} + value: {{ .Values.identityServerClients.identityServiceRootUrl }} - name: "IdentityServerClients__SaasService__RootUrl" - value: {{ .Values.config.identityServerClients.saasServiceRootUrl }} + value: {{ .Values.identityServerClients.saasServiceRootUrl }} - name: "IdentityServerClients__AdministrationService__RootUrl" - value: {{ .Values.config.identityServerClients.administrationServiceRootUrl }} + value: {{ .Values.identityServerClients.administrationServiceRootUrl }} - name: "IdentityServerClients__InternalGateway__RootUrl" - value: {{ .Values.config.identityServerClients.webRootUrl }} + value: {{ .Values.identityServerClients.webRootUrl }} - name: "IdentityServerClients__PublicWebGateway__RootUrl" - value: {{ .Values.config.identityServerClients.publicWebRootUrl }} + value: {{ .Values.identityServerClients.publicWebRootUrl }} - name: "IdentityServerClients__WebGateway__RootUrl" - value: {{ .Values.config.identityServerClients.webGatewayRootUrl }} - + value: {{ .Values.identityServerClients.webGatewayRootUrl }} {{- 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 bf61dbe4..fb40c806 100644 --- a/etc/k8s/eshoponabp/charts/identity/values.yaml +++ b/etc/k8s/eshoponabp/charts/identity/values.yaml @@ -1,30 +1,31 @@ config: selfUrl: # https://eshop-st-identity corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal - identityClientAuthority: # https://eshop-st-authserver - connString: # - administrationService: - connString: # - saasService: - connString: # - dotnetEnv: # - redisHost: # - rabbitmqHost: # - elasticsearchHost: # - authServerAuthority: http://eshop-st-authserver - authServerRequireHttpsMetadata: "false" + connectionStrings: + identityService: # + administrationService: # + saasService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 - identityServerClients: - webRootUrl: # - publicWebRootUrl: # - webGatewayRootUrl: # - publicWebGatewayRootUrl: # - identityServiceRootUrl: # - administrationServiceRootUrl: # - saasServiceRootUrl: # + +# Seeded clients +identityServerClients: + webRootUrl: # + publicWebRootUrl: # + webGatewayRootUrl: # + publicWebGatewayRootUrl: # + identityServiceRootUrl: # + administrationServiceRootUrl: # + saasServiceRootUrl: # ingress: - host: # eshop-st-identity + host: eshop-st-identity tlsSecret: eshop-demo-tls image: diff --git a/etc/k8s/eshoponabp/charts/saas/templates/saas-ingress.yaml b/etc/k8s/eshoponabp/charts/saas/templates/saas-ingress.yaml index d1c8904f..e843265f 100644 --- a/etc/k8s/eshoponabp/charts/saas/templates/saas-ingress.yaml +++ b/etc/k8s/eshoponabp/charts/saas/templates/saas-ingress.yaml @@ -6,16 +6,16 @@ metadata: 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 }}" + 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.global.saasService.domain }} - secretName: {{ .Values.global.tlsSecret }} + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} rules: - - host: "{{ .Values.global.saasService.domain }}" + - host: "{{ .Values.ingress.host }}" http: paths: - path: / diff --git a/etc/k8s/eshoponabp/charts/saas/templates/saas.yaml b/etc/k8s/eshoponabp/charts/saas/templates/saas.yaml index 0ee5dd34..52b83826 100644 --- a/etc/k8s/eshoponabp/charts/saas/templates/saas.yaml +++ b/etc/k8s/eshoponabp/charts/saas/templates/saas.yaml @@ -12,8 +12,8 @@ spec: app: {{ .Release.Name }}-{{ .Chart.Name }} spec: containers: - - image: {{ .Values.global.saasService.containerImage }}:{{ .Values.global.eshoponabpImageVersion }} - imagePullPolicy: {{ .Values.global.imagePullPolicy }} + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} name: {{ .Release.Name }}-{{ .Chart.Name }} ports: - name: http @@ -21,11 +21,28 @@ spec: - name: https containerPort: 443 env: -{{ include "eshoponabp.global.env" . | indent 8 }} + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" - name: "ConnectionStrings__AdministrationService" - value: {{ .Values.global.administrationService.connString }} + value: {{ .Values.config.connectionStrings.administrationService }} - name: "ConnectionStrings__SaasService" - value: {{ .Values.global.saasService.connString }} + value: {{ .Values.config.connectionStrings.saasService }} + - 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: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" {{- if .Values.env }} {{ toYaml .Values.env | indent 8 }} {{- end }} diff --git a/etc/k8s/eshoponabp/charts/saas/values.yaml b/etc/k8s/eshoponabp/charts/saas/values.yaml index 94682c50..badbfdf7 100644 --- a/etc/k8s/eshoponabp/charts/saas/values.yaml +++ b/etc/k8s/eshoponabp/charts/saas/values.yaml @@ -1,6 +1,25 @@ - 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" - \ No newline at end of file +config: + selfUrl: https://eshop-st-saas + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-public-web,https://eshop-st-gateway-internal + connectionStrings: + administrationService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + saasService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: eshop-st-saas + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-saas + 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 a8e540f4..65b22f9b 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -125,7 +125,7 @@ public-web: selfUrl: https://eshop-st-public-web gatewayUrl: "http://eshop-st-gateway-web-public/" authServer: - authority: http://eshop-st-AUTHSERVER + authority: http://eshop-st-authserver requireHttpsMetadata: "false" dotnetEnv: Staging redisHost: es-st-redis @@ -141,27 +141,26 @@ public-web: identity: config: selfUrl: https://eshop-st-identity - corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public,https://eshop-st-gateway-internal - connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" - administrationService: - connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" - saasService: - connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public + connectionStrings: + identityService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + administrationService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + saasService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq - elasticsearchHost: es-st-elasticsearch - authServerAuthority: http://eshop-st-authserver - authServerRequireHttpsMetadata: "false" - stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 - identityServerClients: - webRootUrl: https://eshop-st-web/ - publicWebRootUrl: https://eshop-st-public-web/ - webGatewayRootUrl: https://eshop-st-gateway-web/ - publicWebGatewayRootUrl: https://eshop-st-gateway-web-public/ - identityServiceRootUrl: https://eshop-st-identity/ - administrationServiceRootUrl: https://eshop-st-administration/ - saasServiceRootUrl: https://eshop-st-saas/ + elasticsearchHost: es-st-elasticsearch + identityServerClients: # Seeded Clients + webRootUrl: https://eshop-st-web/ + publicWebRootUrl: https://eshop-st-public-web/ + webGatewayRootUrl: https://eshop-st-gateway-web/ + publicWebGatewayRootUrl: https://eshop-st-gateway-web-public/ + identityServiceRootUrl: https://eshop-st-identity/ + administrationServiceRootUrl: https://eshop-st-administration/ + saasServiceRootUrl: https://eshop-st-saas/ ingress: host: eshop-st-identity image: From d0f32cb34d5751cbcbd51a0f8a0a6d4fc624608e Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 22:00:13 +0300 Subject: [PATCH 10/16] moved readme and removed internal-gateway host info --- etc/{k8s => }/README.md | 1 - 1 file changed, 1 deletion(-) rename etc/{k8s => }/README.md (96%) diff --git a/etc/k8s/README.md b/etc/README.md similarity index 96% rename from etc/k8s/README.md rename to etc/README.md index a33c2ab8..dcc70aa8 100644 --- a/etc/k8s/README.md +++ b/etc/README.md @@ -26,7 +26,6 @@ helm install ingress-nginx ingress-nginx/ingress-nginx 127.0.0.1 eshop-st-saas 127.0.0.1 eshop-st-gateway-web 127.0.0.1 eshop-st-gateway-web-public -127.0.0.1 eshop-st-gateway-internal ```` * Run `build-images.ps1` in the `scripts` directory. From 89a9e0ebe77d2ddbca54d2546837af75a97b19ae Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 23:34:28 +0300 Subject: [PATCH 11/16] administrationService chart update --- ...oy.yaml => administration-deployment.yaml} | 13 +++++---- .../charts/administration/values.yaml | 27 ++++++++++++------- 2 files changed, 23 insertions(+), 17 deletions(-) rename etc/k8s/eshoponabp/charts/administration/templates/{administration-deploy.yaml => administration-deployment.yaml} (80%) diff --git a/etc/k8s/eshoponabp/charts/administration/templates/administration-deploy.yaml b/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml similarity index 80% rename from etc/k8s/eshoponabp/charts/administration/templates/administration-deploy.yaml rename to etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml index 92c827fb..26f80d03 100644 --- a/etc/k8s/eshoponabp/charts/administration/templates/administration-deploy.yaml +++ b/etc/k8s/eshoponabp/charts/administration/templates/administration-deployment.yaml @@ -27,27 +27,26 @@ spec: value: "{{ .Values.config.gatewayUrl }}" - name: App__CorsOrigins value: "{{ .Values.config.corsOrigins }}" - - name: IdentityClients__IdentityClients__Authority - value: "{{ .Values.config.identityClientAuthority }}" + - name: IdentityClients__Default__Authority + value: "{{ .Values.synchedCommunication.authority }}" - name: "ConnectionStrings__AdministrationService" - value: {{ .Values.config.connString }} + value: "{{ .Values.config.connectionStrings.administrationService }}" - name: "ConnectionStrings__SaasService" - value: {{ .Values.config.saasService.connString }} + value: "{{ .Values.config.connectionStrings.saasService }}" - name: "DOTNET_ENVIRONMENT" value: "{{ .Values.config.dotnetEnv }}" - name: "Redis__Configuration" value: "{{ .Values.config.redisHost }}" - name: "AuthServer__Authority" - value: "{{ .Values.config.authServerAuthority }}" + value: "{{ .Values.config.authServer.authority }}" - name: "AuthServer__RequireHttpsMetadata" - value: "{{ .Values.config.authServerRequireHttpsMetadata }}" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" - name: "StringEncryption__DefaultPassPhrase" value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" - name: "RabbitMQ__Connections__Default__HostName" value: "{{ .Values.config.rabbitmqHost }}" - name: "ElasticSearch__Url" value: "{{ .Values.config.elasticsearchHost }}" - {{- if .Values.env }} {{ toYaml .Values.env | indent 8 }} {{- end }} diff --git a/etc/k8s/eshoponabp/charts/administration/values.yaml b/etc/k8s/eshoponabp/charts/administration/values.yaml index 7cbac64b..50b4e536 100644 --- a/etc/k8s/eshoponabp/charts/administration/values.yaml +++ b/etc/k8s/eshoponabp/charts/administration/values.yaml @@ -2,17 +2,24 @@ 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 - identityClientAuthority: # https://eshop-st-authserver - connString: # - saasService: - connString: # - dotnetEnv: # - redisHost: # - rabbitmqHost: # + connectionStrings: + administrationService: # + saasService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq elasticsearchHost: # - authServerAuthority: # - authServerRequireHttpsMetadata: # - stringEncryptionDefaultPassPhrase: # + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +synchedCommunication: + grantType: # "client_credentials" + clientId: # + clientSecret: # + authority: https://eshop-st-authserver + scope: # "IdentityService" ingress: host: # eshop-st-administration From 3785d720a87379a5793bfdd28e6ecbb3b717d4fc Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 23:34:49 +0300 Subject: [PATCH 12/16] gateway-web cors error fix --- .../charts/gateway-web/templates/gateway-web-deployment.yaml | 5 ++++- etc/k8s/eshoponabp/charts/gateway-web/values.yaml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) 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 bcda37ff..75e1f1a0 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 @@ -22,10 +22,13 @@ spec: containerPort: 443 volumeMounts: - name: config-volume - mountPath: /app/appsettings.json + mountPath: /app/appsettings.json + subPath: appsettings.json env: - name: App__SelfUrl value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" - name: GlobalConfiguration__BaseUrl value: "{{ .Values.config.globalConfigurationBaseUrl }}" - name: "DOTNET_ENVIRONMENT" diff --git a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml index ec5ff94f..68d4588f 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml @@ -1,5 +1,6 @@ config: selfUrl: # https://eshop-st-gateway-web + corsOrigins: # localhost:4200 globalConfigurationBaseUrl: # http://eshop-st-gateway-web authServer: authority: http://eshop-st-authserver From 6b5f4ff19bee43227d5012a861b3415005fb666e Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 23:35:12 +0300 Subject: [PATCH 13/16] helm character error for boolean fix --- .../authserver/templates/authserver-deployment.yaml | 12 +++--------- .../public-web/templates/public-web-deployment.yaml | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml index e69ae60d..162929db 100644 --- a/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml @@ -28,21 +28,15 @@ spec: - name: App__RedirectAllowedUrls value: "{{ .Values.config.allowedRedirectUrls }}" - name: "ConnectionStrings__IdentityService" - value: {{ .Values.config.identityService.connString }} - - name: "ConnectionStrings__SaasService" - value: {{ .Values.config.saasService.connString }} + value: "{{ .Values.config.identityService.connString }}" - name: "ConnectionStrings__AdministrationService" - value: {{ .Values.config.administrationService.connString }} + value: "{{ .Values.config.administrationService.connString }}" - name: "ConnectionStrings__SaasService" - value: {{ .Values.config.saasService.connString }} + value: "{{ .Values.config.saasService.connString }}" - name: "DOTNET_ENVIRONMENT" value: "{{ .Values.config.dotnetEnv }}" - name: "Redis__Configuration" value: "{{ .Values.config.redisHost }}" - - name: "AuthServer__Authority" - value: "{{ .Values.config.authServerAuthority }}" - - name: "AuthServer__RequireHttpsMetadata" - value: "{{ .Values.config.authServerRequireHttpsMetadata }}" - name: "StringEncryption__DefaultPassPhrase" value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" - name: "RabbitMQ__Connections__Default__HostName" diff --git a/etc/k8s/eshoponabp/charts/public-web/templates/public-web-deployment.yaml b/etc/k8s/eshoponabp/charts/public-web/templates/public-web-deployment.yaml index fd3201e5..0faddf89 100644 --- a/etc/k8s/eshoponabp/charts/public-web/templates/public-web-deployment.yaml +++ b/etc/k8s/eshoponabp/charts/public-web/templates/public-web-deployment.yaml @@ -28,7 +28,7 @@ spec: - name: "AuthServer__Authority" value: {{ .Values.config.authServer.authority }} - name: "AuthServer__RequireHttpsMetadata" - value: {{ .Values.config.authServer.requireHttpsMetadata }} + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" - name: "DOTNET_ENVIRONMENT" value: {{ .Values.config.dotnetEnv }} - name: "Redis__Configuration" From 7ec03a0d3cb12837160eea7e52e03b5ce36dce9f Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 23:35:30 +0300 Subject: [PATCH 14/16] main value refactoring --- etc/k8s/eshoponabp/values.yaml | 193 ++++++++++++++++----------------- 1 file changed, 96 insertions(+), 97 deletions(-) diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 65b22f9b..514c90ac 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -1,91 +1,3 @@ -# Default values for eshoponabp. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: nginx - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -# administration: - # env: - # - name: "ADMIN_SPECIFIC_ENV_NAME" - # value: "ADMIN_SPECIFIC_ENV_VALUE" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} - # auth-server sub-chart override authserver: config: @@ -164,26 +76,27 @@ identity: ingress: host: eshop-st-identity image: - repository: "eshoponabp/app-identity" + repository: "eshoponabp/service-identity" tag: latest -# sub-chart overrides +# administration sub-chart override 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 - identityClientAuthority: https://eshop-st-authserver - connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" - saasService: - connString: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + connectionStrings: + administrationService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + saasService: "Server=es-st-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" dotnetEnv: Staging redisHost: es-st-redis rabbitmqHost: es-st-rabbitmq elasticsearchHost: es-st-elasticsearch - authServerAuthority: http://eshop-st-authserver - authServerRequireHttpsMetadata: "false" - stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + synchedCommunication: # Used for server-to-server (client-credentials) communication with identityService for user permissions + authority: https://eshop-st-authserver ingress: host: eshop-st-administration image: @@ -194,6 +107,7 @@ administration: gateway-web: config: selfUrl: https://eshop-st-gateway-web + corsOrigins: https://eshop-st-web globalConfigurationBaseUrl: http://eshop-st-gateway-public authServer: authority: http://eshop-st-authserver @@ -221,6 +135,7 @@ gateway-web: schema: http host: eshop-st-saas port: 80 + # gateway-web-public sub-chart override gateway-web-public: config: @@ -260,3 +175,87 @@ gateway-web-public: schema: http host: eshop-st-order port: 80 + + +# Default values for eshoponabp. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} \ No newline at end of file From d6b2a652862c2de27be3796d81a724535a01b7f4 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 23:35:43 +0300 Subject: [PATCH 15/16] updated notes, readme and deploy script --- etc/README.md | 4 ++-- etc/k8s/deploy-staging.ps1 | 4 +--- etc/k8s/eshoponabp/templates/NOTES.txt | 9 +++++++-- etc/k8s/eshoponabp/templates/_helpers.tpl | 17 ----------------- 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/etc/README.md b/etc/README.md index dcc70aa8..b1c368b7 100644 --- a/etc/README.md +++ b/etc/README.md @@ -29,7 +29,7 @@ helm install ingress-nginx ingress-nginx/ingress-nginx ```` * Run `build-images.ps1` in the `scripts` directory. -* Run `deploy-staging.ps1` in the `helm-chart` directory. It is deployed with the `eventhub` namespace. +* Run `deploy-staging.ps1` in the `helm-chart` directory. It is deployed with the `eshop` namespace. * *You may wait ~30 seconds on first run for preparing the database*. -* Browse https://eshoponabp-public-web and https://eshoponabp-authserver +* Browse https://eshop-st-public-web for public and https://eshop-st-web for web application * Username: `admin`, password: `1q2w3E*`. diff --git a/etc/k8s/deploy-staging.ps1 b/etc/k8s/deploy-staging.ps1 index cbdda161..3b3b8f97 100644 --- a/etc/k8s/deploy-staging.ps1 +++ b/etc/k8s/deploy-staging.ps1 @@ -1,3 +1 @@ -param ($version='latest') - -helm upgrade --install es-st eshoponabp --namespace eshop --create-namespace --set global.eshoponabpImageVersion=$version \ No newline at end of file +helm upgrade --install es-st eshoponabp --namespace eshop --create-namespace \ No newline at end of file diff --git a/etc/k8s/eshoponabp/templates/NOTES.txt b/etc/k8s/eshoponabp/templates/NOTES.txt index c9abfbdb..044f1a72 100644 --- a/etc/k8s/eshoponabp/templates/NOTES.txt +++ b/etc/k8s/eshoponabp/templates/NOTES.txt @@ -1,5 +1,10 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} +1. Web (Back Office) angular application URL:{{- if .Values.web.config.selfUrl }} {{ .Values.web.config.selfUrl }} {{- end }} +2. Public Web mvc application URL:{{- if index .Values "public-web" "config" "selfUrl" }} {{ index .Values "public-web" "config" "selfUrl" }} {{- end }} +3. Authentication Server URL:{{- if .Values.authserver.config.selfUrl }} {{ .Values.authserver.config.selfUrl }} + +For RabbitMq Administration use: +"kubectl port-forward services/{{ .Release.Name }}-rabbitmq 15672:15672 -n {{ .Release.Namespace }}" +{{- else if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} diff --git a/etc/k8s/eshoponabp/templates/_helpers.tpl b/etc/k8s/eshoponabp/templates/_helpers.tpl index 140c753f..901e5bb0 100644 --- a/etc/k8s/eshoponabp/templates/_helpers.tpl +++ b/etc/k8s/eshoponabp/templates/_helpers.tpl @@ -60,20 +60,3 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} - -{{- define "eshoponabp.global.env" -}} -- name: "DOTNET_ENVIRONMENT" - value: "{{ .Values.global.dotnetEnvironment }}" -- name: "Redis__Configuration" - value: "{{ .Values.global.redisConfiguration }}" -- name: "AuthServer__Authority" - value: "{{ .Values.global.internalAuthServerAuthority }}" -- name: "AuthServer__RequireHttpsMetadata" - value: "{{ .Values.global.internalAuthServerRequireHttpsMetadata }}" -- name: "StringEncryption__DefaultPassPhrase" - value: "{{ .Values.global.stringEncryptionDefaultPassPhrase }}" -- name: "RabbitMQ__Connections__Default__HostName" - value: "{{ .Values.global.rabbitMqHostName }}" -- name: "ElasticSearch__Url" - value: "{{ .Values.global.elasticSearchUrl }}" -{{- end }} From 7160b461e046b7bfc36c6be6738f5176ff23f190 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Fri, 5 Nov 2021 00:18:51 +0300 Subject: [PATCH 16/16] moved tsl notes --- etc/k8s/tls-cert/README.md | 36 ----------------------- etc/k8s/{eshoponabp => tls-cert}/notes.md | 0 2 files changed, 36 deletions(-) delete mode 100644 etc/k8s/tls-cert/README.md rename etc/k8s/{eshoponabp => tls-cert}/notes.md (100%) diff --git a/etc/k8s/tls-cert/README.md b/etc/k8s/tls-cert/README.md deleted file mode 100644 index 96bc32bf..00000000 --- a/etc/k8s/tls-cert/README.md +++ /dev/null @@ -1,36 +0,0 @@ - ### Pre-requirements - -* Docker Desktop with Kubernetes enabled -* 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 - -helm install ingress-nginx ingress-nginx/ingress-nginx -``` -* Install [Helm](https://helm.sh/docs/intro/install/) for running helm charts - - -### How to run? - -* Add entries to the hosts file (in Windows: `C:\Windows\System32\drivers\etc\hosts`): - -````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. -* Run `deploy-staging.ps1` in the `helm-chart` directory. It is deployed with the `eventhub` namespace. -* *You may wait ~30 seconds on first run for preparing the database*. -* Browse https://eshoponabp-public-web and https://eshoponabp-authserver -* Username: `admin`, password: `1q2w3E*`. diff --git a/etc/k8s/eshoponabp/notes.md b/etc/k8s/tls-cert/notes.md similarity index 100% rename from etc/k8s/eshoponabp/notes.md rename to etc/k8s/tls-cert/notes.md