-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeployment.yaml
101 lines (101 loc) · 3.7 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{{- $svc := printf "%s-postgresql" .Release.Name }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "terminfinder-backend.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "terminfinder-backend.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "terminfinder-backend.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "terminfinder-backend.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
serviceAccountName: {{ include "terminfinder-backend.serviceAccountName" . }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: DB_DATABASE
value: {{ .Values.global.postgresql.auth.database }}
- name: DB_PORT
value: {{ .Values.global.postgresql.service.ports.postgresql | quote }}
- name: DB_ADDRESS
value: {{ printf "%s" $svc }}
- name: DB_USERNAME
value: {{ .Values.global.postgresql.auth.username }}
- name: ASPNETCORE_URLS
value: {{printf "http://+:%d" (int .Values.application.port) }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ required "Postgres DB secret name not set" .Values.global.postgresql.auth.existingSecret }}
key: {{ required "Postgres DB password secretkey not set" .Values.global.postgresql.auth.secretKeys.userPasswordKey }}
- name: Terminfinder__UseHttps
value: "false"
- name: Terminfinder__UseCors
value: {{ .Values.application.useCors | quote }}
- name: Terminfinder__Log4NetConfigFilename
value: log4net.Console.debug.config
- name: ConnectionStrings__TerminfinderConnection
value: "Server=$(DB_ADDRESS),$(DB_PORT);Database=$(DB_DATABASE);User ID=$(DB_USERNAME);password=$(DB_PASSWORD);"
ports:
- name: http
containerPort: {{ int .Values.application.port }}
protocol: TCP
command:
- "dotnet"
- "Dataport.Terminfinder.WebAPI.dll"
{{- if .Values.application.migrateDB }}
- "--dbmigrate"
{{- end }}
startupProbe:
failureThreshold: 3
periodSeconds: 30
httpGet:
path: /app
port: http
livenessProbe:
initialDelaySeconds: 10
httpGet:
path: /app
port: http
readinessProbe:
initialDelaySeconds: 10
httpGet:
path: /app
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}