Browse Source

Merge pull request #12 from abpframework/gterdem/helm-charts

eShopOnAbp helm deployment configuration
pull/13/head
Enis Necipoglu 5 years ago
committed by GitHub
parent
commit
07e7ccfb55
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      etc/k8s/README.md
  2. 3
      etc/k8s/deploy-staging.ps1
  3. 23
      etc/k8s/eshoponabp/.helmignore
  4. 24
      etc/k8s/eshoponabp/Chart.yaml
  5. 6
      etc/k8s/eshoponabp/charts/administration/Chart.yaml
  6. 27
      etc/k8s/eshoponabp/charts/administration/templates/administration-ingress.yaml
  7. 14
      etc/k8s/eshoponabp/charts/administration/templates/administration-service.yaml
  8. 29
      etc/k8s/eshoponabp/charts/administration/templates/administration.yaml
  9. 0
      etc/k8s/eshoponabp/charts/administration/values.yaml
  10. 6
      etc/k8s/eshoponabp/charts/authserver/Chart.yaml
  11. 29
      etc/k8s/eshoponabp/charts/authserver/templates/authserver-ingress.yaml
  12. 14
      etc/k8s/eshoponabp/charts/authserver/templates/authserver-service.yaml
  13. 30
      etc/k8s/eshoponabp/charts/authserver/templates/authserver.yaml
  14. 0
      etc/k8s/eshoponabp/charts/authserver/values.yaml
  15. 6
      etc/k8s/eshoponabp/charts/identity/Chart.yaml
  16. 27
      etc/k8s/eshoponabp/charts/identity/templates/identity-ingress.yaml
  17. 14
      etc/k8s/eshoponabp/charts/identity/templates/identity-service.yaml
  18. 31
      etc/k8s/eshoponabp/charts/identity/templates/identity.yaml
  19. 0
      etc/k8s/eshoponabp/charts/identity/values.yaml
  20. 6
      etc/k8s/eshoponabp/charts/public-web/Chart.yaml
  21. 37
      etc/k8s/eshoponabp/charts/public-web/templates/public-web-ingress.yaml
  22. 14
      etc/k8s/eshoponabp/charts/public-web/templates/public-web-service.yaml
  23. 24
      etc/k8s/eshoponabp/charts/public-web/templates/public-web.yaml
  24. 0
      etc/k8s/eshoponabp/charts/public-web/values.yaml
  25. 6
      etc/k8s/eshoponabp/charts/public-webgateway/Chart.yaml
  26. 37
      etc/k8s/eshoponabp/charts/public-webgateway/templates/public-webgateway-ingress.yaml
  27. 14
      etc/k8s/eshoponabp/charts/public-webgateway/templates/public-webgateway-service.yaml
  28. 24
      etc/k8s/eshoponabp/charts/public-webgateway/templates/public-webgateway.yaml
  29. 0
      etc/k8s/eshoponabp/charts/public-webgateway/values.yaml
  30. 6
      etc/k8s/eshoponabp/charts/rabbitmq/Chart.yaml
  31. 20
      etc/k8s/eshoponabp/charts/rabbitmq/templates/rabbitmq-service.yaml
  32. 25
      etc/k8s/eshoponabp/charts/rabbitmq/templates/rabbitmq.yaml
  33. 0
      etc/k8s/eshoponabp/charts/rabbitmq/values.yaml
  34. 6
      etc/k8s/eshoponabp/charts/redis/Chart.yaml
  35. 13
      etc/k8s/eshoponabp/charts/redis/templates/redis-service.yaml
  36. 20
      etc/k8s/eshoponabp/charts/redis/templates/redis.yaml
  37. 0
      etc/k8s/eshoponabp/charts/redis/values.yaml
  38. 6
      etc/k8s/eshoponabp/charts/saas/Chart.yaml
  39. 27
      etc/k8s/eshoponabp/charts/saas/templates/saas-ingress.yaml
  40. 14
      etc/k8s/eshoponabp/charts/saas/templates/saas-service.yaml
  41. 29
      etc/k8s/eshoponabp/charts/saas/templates/saas.yaml
  42. 0
      etc/k8s/eshoponabp/charts/saas/values.yaml
  43. 6
      etc/k8s/eshoponabp/charts/sqlserver/Chart.yaml
  44. 14
      etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver-service.yaml
  45. 43
      etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver.yaml
  46. 0
      etc/k8s/eshoponabp/charts/sqlserver/values.yaml
  47. 22
      etc/k8s/eshoponabp/templates/NOTES.txt
  48. 79
      etc/k8s/eshoponabp/templates/_helpers.tpl
  49. 15
      etc/k8s/eshoponabp/templates/tests/test-connection.yaml
  50. 121
      etc/k8s/eshoponabp/values.yaml
  51. 6
      services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json

33
etc/k8s/README.md

@ -0,0 +1,33 @@
### 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
```
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`):
````
127.0.0.1 eshoponabp-public-web
127.0.0.1 eshoponabp-authserver
127.0.0.1 eshoponabp-identity
127.0.0.1 eshoponabp-administration
127.0.0.1 eshoponabp-saas
127.0.0.1 eshoponabp-public-webgateway
````
* 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*`.

3
etc/k8s/deploy-staging.ps1

@ -0,0 +1,3 @@
param ($version='latest')
helm upgrade --install eshoponabp eshoponabp --namespace eshop --create-namespace --set global.eventHubImageVersion=$version

23
etc/k8s/eshoponabp/.helmignore

@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

24
etc/k8s/eshoponabp/Chart.yaml

@ -0,0 +1,24 @@
apiVersion: v2
name: eshoponabp
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"

6
etc/k8s/eshoponabp/charts/administration/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: administration
appVersion: "1.0"
description: eShopOnAbp Administration Microservice
version: 1.0.0
type: application

27
etc/k8s/eshoponabp/charts/administration/templates/administration-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: "{{ .Values.global.nginxProxyBufferSize }}"
nginx.ingress.kubernetes.io/proxy-buffers-number: "{{ .Values.global.nginxProxyBuffersNumber }}"
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts:
- {{ .Values.global.administrationService.domain }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
- host: "{{ .Values.global.administrationService.domain }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

14
etc/k8s/eshoponabp/charts/administration/templates/administration-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 }}

29
etc/k8s/eshoponabp/charts/administration/templates/administration.yaml

@ -0,0 +1,29 @@
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.administrationService.containerImage }}:{{ .Values.global.eventHubImageVersion }}
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__AdministrationService"
value: {{ .Values.global.administrationService.connString }}
- name: "ConnectionStrings__SaasService"
value: {{ .Values.global.saasService.connString }}

0
etc/k8s/eshoponabp/charts/administration/values.yaml

6
etc/k8s/eshoponabp/charts/authserver/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: authserver
appVersion: "1.0"
description: eShopOnAbp AuthServer Application
version: 1.0.0
type: application

29
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.authServer.domain }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
- host: "{{ .Values.global.authServer.domain }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

14
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 }}

30
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.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 }}

0
etc/k8s/eshoponabp/charts/authserver/values.yaml

6
etc/k8s/eshoponabp/charts/identity/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: identity
appVersion: "1.0"
description: eShopOnAbp Identity Microservice
version: 1.0.0
type: application

27
etc/k8s/eshoponabp/charts/identity/templates/identity-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: "{{ .Values.global.nginxProxyBufferSize }}"
nginx.ingress.kubernetes.io/proxy-buffers-number: "{{ .Values.global.nginxProxyBuffersNumber }}"
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts:
- {{ .Values.global.identityService.domain }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
- host: "{{ .Values.global.identityService.domain }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

14
etc/k8s/eshoponabp/charts/identity/templates/identity-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 }}

31
etc/k8s/eshoponabp/charts/identity/templates/identity.yaml

@ -0,0 +1,31 @@
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.eventHubImageVersion }}
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 }}

0
etc/k8s/eshoponabp/charts/identity/values.yaml

6
etc/k8s/eshoponabp/charts/public-web/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: public-web
appVersion: "1.0"
description: eShopOnAbp Public Web Application
version: 1.0.0
type: application

37
etc/k8s/eshoponabp/charts/public-web/templates/public-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.publicWeb.domain }}
{{- if eq .Release.Name "eh-az" }}
- {{ print "www." .Values.global.publicWeb.domain }}
{{- end }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
{{- if eq .Release.Name "eh-az" }}
- host: "{{ print "www." .Values.global.publicWeb.domain }}"
{{- else }}
- host: "{{ .Values.global.publicWeb.domain }}"
{{- end }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

14
etc/k8s/eshoponabp/charts/public-web/templates/public-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 }}

24
etc/k8s/eshoponabp/charts/public-web/templates/public-web.yaml

@ -0,0 +1,24 @@
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:
{{ include "eshoponabp.global.env" . | indent 8 }}

0
etc/k8s/eshoponabp/charts/public-web/values.yaml

6
etc/k8s/eshoponabp/charts/public-webgateway/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: public-webgateway
appVersion: "1.0"
description: eShopOnAbp Public Web Gateway Application
version: 1.0.0
type: application

37
etc/k8s/eshoponabp/charts/public-webgateway/templates/public-webgateway-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.publicWebGateway.domain }}
{{- if eq .Release.Name "eh-az" }}
- {{ print "www." .Values.global.publicWebGateway.domain }}
{{- end }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
{{- if eq .Release.Name "eh-az" }}
- host: "{{ print "www." .Values.global.publicWebGateway.domain }}"
{{- else }}
- host: "{{ .Values.global.publicWebGateway.domain }}"
{{- end }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

14
etc/k8s/eshoponabp/charts/public-webgateway/templates/public-webgateway-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 }}

24
etc/k8s/eshoponabp/charts/public-webgateway/templates/public-webgateway.yaml

@ -0,0 +1,24 @@
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.publicWebGateway.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 }}

0
etc/k8s/eshoponabp/charts/public-webgateway/values.yaml

6
etc/k8s/eshoponabp/charts/rabbitmq/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: rabbitmq
appVersion: "1.0"
description: Runs RabbitMQ Message Broker Instance
version: 1.0.0
type: application

20
etc/k8s/eshoponabp/charts/rabbitmq/templates/rabbitmq-service.yaml

@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
labels:
name: {{ .Release.Name }}-{{ .Chart.Name }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
type: ClusterIP
ports:
- name: http
protocol: TCP
port: 15672
targetPort: 15672
- name: amqp
protocol: TCP
port: 5672
targetPort: 5672
selector:
app: {{ .Release.Name }}-{{ .Chart.Name }}

25
etc/k8s/eshoponabp/charts/rabbitmq/templates/rabbitmq.yaml

@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
serviceName: {{ .Release.Name }}-{{ .Chart.Name }}
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: rabbitmq:management-alpine
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: http
protocol: TCP
containerPort: 15672
- name: amqp
protocol: TCP
containerPort: 5672

0
etc/k8s/eshoponabp/charts/rabbitmq/values.yaml

6
etc/k8s/eshoponabp/charts/redis/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: redis
appVersion: "1.0"
description: Runs Redis instance
version: 1.0.0
type: application

13
etc/k8s/eshoponabp/charts/redis/templates/redis-service.yaml

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
labels:
name: {{ .Release.Name }}-{{ .Chart.Name }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
type: ClusterIP
ports:
- name: redis
port: 6379
selector:
app: {{ .Release.Name }}-{{ .Chart.Name }}

20
etc/k8s/eshoponabp/charts/redis/templates/redis.yaml

@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: redis:alpine
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: redis
containerPort: 6379

0
etc/k8s/eshoponabp/charts/redis/values.yaml

6
etc/k8s/eshoponabp/charts/saas/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: saas
appVersion: "1.0"
description: eShopOnAbp Saas Microservice
version: 1.0.0
type: application

27
etc/k8s/eshoponabp/charts/saas/templates/saas-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: "{{ .Values.global.nginxProxyBufferSize }}"
nginx.ingress.kubernetes.io/proxy-buffers-number: "{{ .Values.global.nginxProxyBuffersNumber }}"
cert-manager.io/cluster-issuer: letsencrypt
spec:
tls:
- hosts:
- {{ .Values.global.identityService.domain }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
- host: "{{ .Values.global.identityService.domain }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

14
etc/k8s/eshoponabp/charts/saas/templates/saas-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 }}

29
etc/k8s/eshoponabp/charts/saas/templates/saas.yaml

@ -0,0 +1,29 @@
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.saasService.containerImage }}:{{ .Values.global.eventHubImageVersion }}
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__AdministrationService"
value: {{ .Values.global.administrationService.connString }}
- name: "ConnectionStrings__SaasService"
value: {{ .Values.global.saasService.connString }}

0
etc/k8s/eshoponabp/charts/saas/values.yaml

6
etc/k8s/eshoponabp/charts/sqlserver/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: sqldb
appVersion: "1.0"
description: Runs SQL Server Instance
version: 1.0.0
type: application

14
etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver-service.yaml

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
name: {{ .Release.Name }}-{{ .Chart.Name }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
type: ClusterIP
ports:
- name: sqlserver
port: 1433
selector:
app: {{ .Release.Name }}-{{ .Chart.Name }}

43
etc/k8s/eshoponabp/charts/sqlserver/templates/sqlserver.yaml

@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
serviceName: {{ .Release.Name }}-{{ .Chart.Name }}
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: mcr.microsoft.com/mssql/server
name: {{ .Release.Name }}-{{ .Chart.Name }}
{{- if eq .Release.Name "eh-az" }}
volumeMounts:
- mountPath: "/var/opt/mssql"
name: {{ .Release.Name }}-{{ .Chart.Name }}-database-volume
subPath: sqlserver-data
{{- end }}
ports:
- name: sqlserver
containerPort: 1433
env:
- name: SA_PASSWORD
value: "myPassw@rd"
- name: ACCEPT_EULA
value: "Y"
{{- if eq .Release.Name "eh-az" }}
volumeClaimTemplates:
- metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-database-volume
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "managed-premium-retain"
resources:
requests:
storage: 32Gi
{{- end }}

0
etc/k8s/eshoponabp/charts/sqlserver/values.yaml

22
etc/k8s/eshoponabp/templates/NOTES.txt

@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "eshoponabp.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "eshoponabp.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "eshoponabp.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "eshoponabp.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}

79
etc/k8s/eshoponabp/templates/_helpers.tpl

@ -0,0 +1,79 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "eshoponabp.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "eshoponabp.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "eshoponabp.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "eshoponabp.labels" -}}
helm.sh/chart: {{ include "eshoponabp.chart" . }}
{{ include "eshoponabp.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "eshoponabp.selectorLabels" -}}
app.kubernetes.io/name: {{ include "eshoponabp.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "eshoponabp.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "eshoponabp.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{- define "eshoponabp.global.env" -}}
- name: "DOTNET_ENVIRONMENT"
value: "{{ .Values.global.dotnetEnvironment }}"
- name: "AppUrls__ApiInternal"
value: "{{ .Values.global.apiUrlInternal }}"
- 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 }}"
{{- end }}

15
etc/k8s/eshoponabp/templates/tests/test-connection.yaml

@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "eshoponabp.fullname" . }}-test-connection"
labels:
{{- include "eshoponabp.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "eshoponabp.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never

121
etc/k8s/eshoponabp/values.yaml

@ -0,0 +1,121 @@
# Default values for eshoponabp.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nginx
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
nodeSelector: {}
tolerations: []
affinity: {}
global:
dotnetEnvironment: "Staging"
imagePullPolicy: Never
eshoponabpImageVersion: latest
publicWeb:
domain: eshoponabp-public-web
url: https://eshoponabp-public-web
containerImage: "eshoponabp/app-publicweb"
authServer:
domain: eshoponabp-authserver
url: https://eshoponabp-authserver
containerImage: "eshoponabp/app-authserver"
identityService:
domain: eshoponabp-identity
url: https://eshoponabp-identity
containerImage: "eshoponabp/service-identity"
connString: "Server=eshoponabp-sqldb,1433;Database=EShopOnAbp_Identity;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true"
administrationService:
domain: eshoponabp-administration
url: https://eshoponabp-administration
containerImage: "eshoponabp/service-administration"
connString: "Server=eshoponabp-sqldb,1433;Database=EShopOnAbp_Administration;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true"
saasService:
domain: eshoponabp-saas
url: https://eshoponabp-saas
containerImage: "eshoponabp/service-saas"
connString: "Server=eshoponabp-sqldb,1433;Database=EShopOnAbp_Saas;User Id=sa;password=myPassw@rd;MultipleActiveResultSets=true"
publicWebGateway:
domain: eshoponabp-public-webgateway
url: https://eshoponabp-public-webgateway
containerImage: "eshoponabp/gateway-publicweb"
redisConfiguration: "eshoponabp-redis"
rabbitMqHostName: "eshoponabp-rabbitmq"
nginxProxyBufferSize: "32k"
nginxProxyBuffersNumber: "8"
internalAuthServerAuthority: "http://eshoponabp-authserver"
internalAuthServerRequireHttpsMetadata: "false"
stringEncryptionDefaultPassPhrase: "gsKnGZ041HLL4IM8"

6
services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json

@ -74,12 +74,6 @@
},
"PaymentService": {
"RootUrl": "https://localhost:44357"
},
"WebGateway": {
"RootUrl": "https://localhost:44372"
},
"WebPublicGateway": {
"RootUrl": "https://localhost:44373"
}
}
}

Loading…
Cancel
Save