diff --git a/etc/k8s/README.md b/etc/README.md similarity index 84% rename from etc/k8s/README.md rename to etc/README.md index 96bc32bf..b1c368b7 100644 --- a/etc/k8s/README.md +++ b/etc/README.md @@ -25,12 +25,11 @@ 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-internal +127.0.0.1 eshop-st-gateway-web-public ```` * 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/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 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..162929db --- /dev/null +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-deployment.yaml @@ -0,0 +1,49 @@ +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__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: "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/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.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 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-ingress.yaml b/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-ingress.yaml deleted file mode 100644 index 5e887ccf..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-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.gatewayPublicWeb.domain }} -{{- if eq .Release.Name "es-az" }} - - {{ print "www." .Values.global.gatewayPublicWeb.domain }} -{{- end }} - secretName: {{ .Values.global.tlsSecret }} - rules: -{{- if eq .Release.Name "es-az" }} - - host: "{{ print "www." .Values.global.gatewayPublicWeb.domain }}" -{{- else }} - - host: "{{ .Values.global.gatewayPublicWeb.domain }}" -{{- end }} - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: {{ .Release.Name }}-{{ .Chart.Name }} - port: - number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-service.yaml b/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-service.yaml deleted file mode 100644 index ee157c01..00000000 --- a/etc/k8s/eshoponabp/charts/gateway-public-web/templates/gateway-public-web-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-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 61% 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 index fe62f397..88f4794e 100644 --- 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 @@ -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/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-internal/templates/gateway-internal-ingress.yaml b/etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-ingress.yaml similarity index 56% rename from etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-ingress.yaml rename to etc/k8s/eshoponabp/charts/gateway-web-public/templates/gateway-web-public-ingress.yaml index 8af97019..539025ac 100644 --- a/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-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.gatewayInternal.domain }} + - {{ .Values.ingress.host }} {{- if eq .Release.Name "es-az" }} - - {{ print "www." .Values.global.gatewayInternal.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.gatewayInternal.domain }}" + - host: "{{ print "www." .Values.ingress.host }}" {{- else }} - - host: "{{ .Values.global.gatewayInternal.domain }}" + - host: "{{ .Values.ingress.host }}" {{- end }} http: paths: diff --git a/etc/k8s/eshoponabp/charts/gateway-internal/templates/gateway-internal-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-internal/templates/gateway-internal-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..321eeaca --- /dev/null +++ b/etc/k8s/eshoponabp/charts/gateway-web-public/values.yaml @@ -0,0 +1,45 @@ +config: + selfUrl: https://eshop-st-gateway-public-web + 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: # + 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-web-public + 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/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..75e1f1a0 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/gateway-web/templates/gateway-web-deployment.yaml @@ -0,0 +1,54 @@ +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: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - 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..68d4588f 100644 --- a/etc/k8s/eshoponabp/charts/gateway-web/values.yaml +++ b/etc/k8s/eshoponabp/charts/gateway-web/values.yaml @@ -1,37 +1,35 @@ - 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 + corsOrigins: # localhost:4200 + 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/charts/identity/templates/identity-deployment.yaml b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml new file mode 100644 index 00000000..072eb431 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/identity/templates/identity-deployment.yaml @@ -0,0 +1,67 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__IdentityService" + value: {{ .Values.config.connectionStrings.identityService }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "ConnectionStrings__SaasService" + 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 }}" + - name: "IdentityServerClients__Web__RootUrl" + value: {{ .Values.identityServerClients.webRootUrl }} + - name: "IdentityServerClients__PublicWeb__RootUrl" + value: {{ .Values.identityServerClients.publicWebRootUrl }} + - name: "IdentityServerClients__IdentityService__RootUrl" + value: {{ .Values.identityServerClients.identityServiceRootUrl }} + - name: "IdentityServerClients__SaasService__RootUrl" + value: {{ .Values.identityServerClients.saasServiceRootUrl }} + - name: "IdentityServerClients__AdministrationService__RootUrl" + value: {{ .Values.identityServerClients.administrationServiceRootUrl }} + - name: "IdentityServerClients__InternalGateway__RootUrl" + value: {{ .Values.identityServerClients.webRootUrl }} + - name: "IdentityServerClients__PublicWebGateway__RootUrl" + value: {{ .Values.identityServerClients.publicWebRootUrl }} + - name: "IdentityServerClients__WebGateway__RootUrl" + value: {{ .Values.identityServerClients.webGatewayRootUrl }} + {{- 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..fb40c806 100644 --- a/etc/k8s/eshoponabp/charts/identity/values.yaml +++ b/etc/k8s/eshoponabp/charts/identity/values.yaml @@ -1,22 +1,37 @@ - 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 + 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 + +# Seeded clients +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/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..0faddf89 --- /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/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/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/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 }} diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 1498ad2c..514c90ac 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -1,3 +1,182 @@ +# auth-server sub-chart override +authserver: + config: + selfUrl: https://eshop-st-authserver + 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" + 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 + +# 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: + 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: + selfUrl: https://eshop-st-identity + 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 + 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: + repository: "eshoponabp/service-identity" + tag: latest + +# 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 + 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 + 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: + repository: "eshoponabp/service-administration" + tag: latest + +# gateway-web sub-chart override +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 + 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 + 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 + 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 + + # Default values for eshoponabp. # This is a YAML-formatted file. # Declare variables to be passed into your templates. @@ -10,11 +189,6 @@ image: # 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: "" @@ -84,80 +258,4 @@ nodeSelector: {} tolerations: [] -affinity: {} - -# sub-chart overrides -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 - 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" - dotnetEnv: Staging - redisHost: es-st-redis - rabbitmqHost: es-st-rabbitmq - elasticsearchHost: es-st-elasticsearch - authServerAuthority: http://eshop-st-authserver - authServerRequireHttpsMetadata: "false" - stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 - ingress: - host: eshop-st-administration - image: - repository: "eshoponabp/service-administration" - 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 +affinity: {} \ No newline at end of file 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 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