diff --git a/etc/k8s/eshoponabp/charts/authserver/Chart.yaml b/etc/k8s/eshoponabp/charts/authserver/Chart.yaml new file mode 100644 index 00000000..361d0a7e --- /dev/null +++ b/etc/k8s/eshoponabp/charts/authserver/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: authserver +appVersion: "1.0" +description: eShop AuthServer Application +version: 1.0.0 +type: application \ 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 new file mode 100644 index 00000000..b1695560 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-ingress.yaml @@ -0,0 +1,29 @@ +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 }}" + cert-manager.io/cluster-issuer: letsencrypt + nginx.ingress.kubernetes.io/configuration-snippet: | + more_set_input_headers "from-ingress: true"; +spec: + tls: + - hosts: + - {{ .Values.global.authServerDomain }} + secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls + rules: + - host: "{{ .Values.global.authServerDomain }}" + 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/authserver/templates/authserver-service.yaml b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-service.yaml new file mode 100644 index 00000000..ee157c01 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver-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/authserver/templates/authserver.yaml b/etc/k8s/eshoponabp/charts/authserver/templates/authserver.yaml new file mode 100644 index 00000000..c52e9430 --- /dev/null +++ b/etc/k8s/eshoponabp/charts/authserver/templates/authserver.yaml @@ -0,0 +1,30 @@ +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.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.identityServiceConnString }} + - name: "ConnectionStrings__AdministrationService" + value: {{ .Values.global.administrationServiceConnString }} + - name: "ConnectionStrings__SaasService" + value: {{ .Values.global.saasServiceConnString }} diff --git a/etc/k8s/eshoponabp/charts/authserver/values.yaml b/etc/k8s/eshoponabp/charts/authserver/values.yaml new file mode 100644 index 00000000..e69de29b diff --git a/etc/k8s/eshoponabp/charts/sqlserver/Chart.yaml b/etc/k8s/eshoponabp/charts/sqlserver/Chart.yaml index dab9de40..647c03d2 100644 --- a/etc/k8s/eshoponabp/charts/sqlserver/Chart.yaml +++ b/etc/k8s/eshoponabp/charts/sqlserver/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: sqlserver +name: sqldb appVersion: "1.0" description: Runs SQL Server Instance version: 1.0.0 diff --git a/etc/k8s/eshoponabp/templates/_helpers.tpl b/etc/k8s/eshoponabp/templates/_helpers.tpl index 901e5bb0..ef7abc38 100644 --- a/etc/k8s/eshoponabp/templates/_helpers.tpl +++ b/etc/k8s/eshoponabp/templates/_helpers.tpl @@ -60,3 +60,28 @@ 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: "AppUrls__Account" + value: "{{ .Values.global.authServerUrl }}" +- name: "AppUrls__Web" + value: "{{ .Values.global.webUrl }}" +- name: "AppUrls__Api" + value: "{{ .Values.global.apiUrl }}" +- name: "AppUrls__ApiInternal" + value: "{{ .Values.global.apiUrlInternal }}" +- name: "AppUrls__Admin" + value: "{{ .Values.global.adminUrl }}" +- name: "AppUrls__AdminApi" + value: "{{ .Values.global.adminApiUrl }}" +- 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 }}" +{{- end }} diff --git a/etc/k8s/eshoponabp/values.yaml b/etc/k8s/eshoponabp/values.yaml index 26502a7b..bad0bc63 100644 --- a/etc/k8s/eshoponabp/values.yaml +++ b/etc/k8s/eshoponabp/values.yaml @@ -80,3 +80,29 @@ nodeSelector: {} tolerations: [] affinity: {} + +global: + dotnetEnvironment: "Staging" + authServer: + domain: eshoponabp-authserver + url: https://eshoponabp-authserver + containerImage: "eshoponabp.authserver" + identityService: + domain: eshoponabp-identity + url: https://eshoponabp-identity + containerImage: "eshoponabp.identity" + connString: "Server=eshoponabp-sqldb,1434;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + administrationService: + domain: eshoponabp-administration + url: https://eshoponabp-administration + containerImage: "eshoponabp.authserver" + connString: "Server=eshoponabp-sqldb,1434;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + saasService: + domain: eshoponabp-saas + url: https://eshoponabp-saas + containerImage: "eshoponabp.saas" + connString: "Server=eshoponabp-sqldb,1434;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true" + redisConfiguration: "eshoponabp-redis" + nginxProxyBufferSize: "32k" + nginxProxyBuffersNumber: "8" + eshoponabpImageVersion: latest \ No newline at end of file