From 8d09213a786ed57ed8b17cf33ed235c702d74cf3 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 4 Nov 2021 20:54:17 +0300 Subject: [PATCH] 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: