diff --git a/etc/k8s/eshoponabp/charts/web/Chart.yaml b/etc/k8s/eshoponabp/charts/web/Chart.yaml new file mode 100644 index 00000000..3a66440f --- /dev/null +++ b/etc/k8s/eshoponabp/charts/web/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: web +appVersion: "1.0" +description: eShopOnAbp BackOffice Web Application +version: 1.0.0 +type: application \ 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 new file mode 100644 index 00000000..59748ad2 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/web/templates/web-ingress.yaml @@ -0,0 +1,37 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress + annotations: + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-buffer-size: "{{ .Values.global.nginxProxyBufferSize }}" + nginx.ingress.kubernetes.io/proxy-buffers-number: "{{ .Values.global.nginxProxyBuffersNumber }}" +{{- if eq .Release.Name "eh-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 }} +{{- end }} + secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls + rules: +{{- if eq .Release.Name "eh-az" }} + - host: "{{ print "www." .Values.global.web.domain }}" +{{- else }} + - host: "{{ .Values.global.web.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/web/templates/web-service.yaml b/etc/k8s/eshoponabp/charts/web/templates/web-service.yaml new file mode 100644 index 00000000..ee157c01 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/web/templates/web-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: {{ .Release.Name }}-{{ .Chart.Name }} + name: {{ .Release.Name }}-{{ .Chart.Name }} +spec: + ports: + - name: "80" + port: 80 + - name: "443" + port: 443 + selector: + app: {{ .Release.Name }}-{{ .Chart.Name }} diff --git a/etc/k8s/eshoponabp/charts/web/templates/web.yaml b/etc/k8s/eshoponabp/charts/web/templates/web.yaml new file mode 100644 index 00000000..da0d1103 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/web/templates/web.yaml @@ -0,0 +1,27 @@ +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.web.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 }} + {{- if .Values.env }} +{{ toYaml .Values.env | indent 8 }} + {{- end }} \ No newline at end of file diff --git a/etc/k8s/eshoponabp/charts/web/values.yaml b/etc/k8s/eshoponabp/charts/web/values.yaml new file mode 100644 index 00000000..b0dac656 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/web/values.yaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 4b7327d4..23160090 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -90,6 +90,10 @@ global: dotnetEnvironment: "Staging" imagePullPolicy: Never eshoponabpImageVersion: latest + 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