From 32294da577c77478ff1d4d83e174c97f0dbf0093 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 9 Feb 2022 02:47:08 +0300 Subject: [PATCH] added payment helm chart --- etc/k8s/eshoponabp/charts/payment/Chart.yaml | 6 +++ .../payment/templates/payment-deployment.yaml | 53 +++++++++++++++++++ .../payment/templates/payment-ingress.yaml | 27 ++++++++++ .../payment/templates/payment-service.yaml | 14 +++++ etc/k8s/eshoponabp/charts/payment/values.yaml | 28 ++++++++++ etc/k8s/eshoponabp/values.yaml | 26 ++++++++- 6 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 etc/k8s/eshoponabp/charts/payment/Chart.yaml create mode 100644 etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml create mode 100644 etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml create mode 100644 etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml create mode 100644 etc/k8s/eshoponabp/charts/payment/values.yaml diff --git a/etc/k8s/eshoponabp/charts/payment/Chart.yaml b/etc/k8s/eshoponabp/charts/payment/Chart.yaml new file mode 100644 index 00000000..1cb23f7c --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: payment +appVersion: "1.0" +description: eShopOnAbp Payment Microservice +version: 1.0.0 +type: application \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml new file mode 100644 index 00000000..78bcb82e --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Chart.Name }} + spec: + containers: + - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: {{ .Release.Name }}-{{ .Chart.Name }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + env: + - name: App__SelfUrl + value: "{{ .Values.config.selfUrl }}" + - name: App__CorsOrigins + value: "{{ .Values.config.corsOrigins }}" + - name: "ConnectionStrings__OrderingService" + value: {{ .Values.config.connectionStrings.orderingService }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.config.connectionStrings.administrationService }} + - name: "DOTNET_ENVIRONMENT" + value: "{{ .Values.config.dotnetEnv }}" + - name: "Redis__Configuration" + value: "{{ .Values.config.redisHost }}" + - name: "RabbitMQ__Connections__Default__HostName" + value: "{{ .Values.config.rabbitmqHost }}" + - name: "ElasticSearch__Url" + value: "{{ .Values.config.elasticsearchHost }}" + - name: "AuthServer__Authority" + value: "{{ .Values.config.authServer.authority }}" + - name: "AuthServer__RequireHttpsMetadata" + value: "{{ .Values.config.authServer.requireHttpsMetadata }}" + - name: "AuthServer__SwaggerClientId" + value: "{{ .Values.config.authServer.swaggerClientId }}" + - name: "AuthServer__SwaggerClientSecret" + value: "{{ .Values.config.authServer.swaggerClientSecret }}" + - name: "StringEncryption__DefaultPassPhrase" + value: "{{ .Values.config.stringEncryptionDefaultPassPhrase }}" + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} + diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml new file mode 100644 index 00000000..e843265f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-ingress.yaml @@ -0,0 +1,27 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k + nginx.ingress.kubernetes.io/proxy-buffers-number: "8" + cert-manager.io/cluster-issuer: letsencrypt +spec: + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Values.ingress.tlsSecret }} + rules: + - host: "{{ .Values.ingress.host }}" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }}-{{ .Chart.Name }} + port: + number: 80 \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml b/etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml new file mode 100644 index 00000000..ee157c01 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/templates/payment-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/payment/values.yaml b/etc/k8s/eshoponabp/charts/payment/values.yaml new file mode 100644 index 00000000..a4f316a0 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/payment/values.yaml @@ -0,0 +1,28 @@ +config: + selfUrl: # https://eshop-st-payment + corsOrigins: # https://eshop-st-gateway-web,https://eshop-st-gateway-public-web + connectionStrings: + paymentService: # + administrationService: # + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + stringEncryptionDefaultPassPhrase: gsKnGZ041HLL4IM8 + +ingress: + host: eshop-st-payment + tlsSecret: eshop-demo-tls + +image: + repository: eshoponabp/service-payment + tag: latest + pullPolicy: IfNotPresent + +env: {} + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index f5eb4b19..14f20bcc 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -221,12 +221,12 @@ catalog: tag: latest # ordering-service sub-chart override -catalog: +ordering: config: selfUrl: https://eshop-st-ordering corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public connectionStrings: - orderingService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Ordering;User ID=postgres;password=myPassw0rd; + orderingService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Ordering;User ID=postgres;password=myPassw0rd;Pooling=false" administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" authServer: authority: http://eshop-st-authserver @@ -243,6 +243,28 @@ catalog: repository: "eshoponabp/service-ordering" tag: latest +# payment-service sub-chart override +payment: + config: + selfUrl: https://eshop-st-payment + corsOrigins: https://eshop-st-gateway-web,https://eshop-st-gateway-web-public + connectionStrings: + paymentService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Payment;User ID=postgres;password=myPassw0rd;Pooling=false" + administrationService: "Host=es-st-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-st-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Staging + redisHost: es-st-redis + rabbitmqHost: es-st-rabbitmq + elasticsearchHost: es-st-elasticsearch + ingress: + host: eshop-st-payment + image: + repository: "eshoponabp/service-payment" + tag: latest # Default values for eshoponabp. # This is a YAML-formatted file.