-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathdeployment_backend.yaml
More file actions
194 lines (194 loc) · 7.09 KB
/
deployment_backend.yaml
File metadata and controls
194 lines (194 loc) · 7.09 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "retool.fullname" . }}
labels:
{{- include "retool.labels" . | nindent 4 }}
{{- if .Values.deployment.annotations }}
annotations:
{{ toYaml .Values.deployment.annotations | indent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "retool.selectorLabels" . | nindent 6 }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
template:
metadata:
annotations:
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "retool.selectorLabels" . | nindent 8 }}
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "retool.serviceAccountName" . }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
{{- if .Values.initContainers }}
initContainers:
{{- range $key, $value := .Values.initContainers }}
- name: "{{ $key }}"
{{ toYaml $value | indent 8 }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- bash
- -c
- chmod -R +x ./docker_scripts; sync; ./docker_scripts/wait-for-it.sh -t 0 {{ template "retool.postgresql.host" . }}:{{ template "retool.postgresql.port" . }}; ./docker_scripts/start_api.sh
{{- if .Values.commandline.args }}
{{ toYaml .Values.commandline.args | indent 10 }}
{{- end }}
env:
- name: SCIM_AUTH_TOKEN
value: {{ .Values.config.auth.onelogin.scimAuthToken | quote }}
- name: NODE_ENV
value: production
{{- if gt (int (toString (.Values.replicaCount))) 1 }}
- name: SERVICE_TYPE
value: MAIN_BACKEND,DB_CONNECTOR
{{- end }}
- name: COOKIE_INSECURE
value: {{ .Values.config.useInsecureCookies | quote }}
- name: POSTGRES_HOST
value: {{ template "retool.postgresql.host" . }}
- name: POSTGRES_PORT
value: {{ template "retool.postgresql.port" . }}
- name: POSTGRES_DB
value: {{ template "retool.postgresql.db" . }}
{{- if not .Values.externalSecrets.enabled }}
- name: LICENSE_KEY
valueFrom:
secretKeyRef:
name: {{ template "retool.fullname" . }}
key: license-key
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: {{ template "retool.fullname" . }}
key: jwt-secret
- name: ENCRYPTION_KEY
valueFrom:
secretKeyRef:
name: {{ template "retool.fullname" . }}
key: encryption-key
- name: POSTGRES_USER
value: {{ template "retool.postgresql.user" . }}
- name: POSTGRES_SSL_ENABLED
value: {{ template "retool.postgresql.ssl_enabled" . }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
{{- if .Values.postgresql.enabled }}
name: {{ template "retool.postgresql.fullname" . }}
{{- else }}
name: {{ template "retool.fullname" . }}
{{- end }}
key: postgresql-password
#- name: CLIENT_ID
# value: {{ default "" .Values.config.auth.google.clientId }}
#- name: CLIENT_SECRET
# valueFrom:
# secretKeyRef:
# name: {{ template "retool.fullname" . }}
# key: google-client-secret
#- name: RESTRICTED_DOMAIN
# value: {{ default "" .Values.config.auth.google.domain }}
- name: BASE_DOMAIN
value: {{ default "" .Values.config.baseDomain }}
- name: GITHUB_APP_ID
value: {{ .Values.config.githubAppId | default "" | quote }}
- name: GITHUB_APP_INSTALLATION_ID
value: {{ .Values.config.githubAppInstallationId | default "" | quote }}
- name: GITHUB_APP_PRIVATE_KEY
value: {{ .Values.config.githubAppPrivateKey | default "" | quote }}
- name: VERSION_CONTROL_LOCKED
value: {{ .Values.config.versionControlLocked | default "" | quote }}
{{- end }}
{{- range $key, $value := .Values.env }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- if .Values.externalSecrets.enabled }}
envFrom:
- secretRef:
name: {{ .Values.externalSecrets.name }}
{{- end }}
ports:
- containerPort: {{ .Values.service.internalPort }}
name: {{ template "retool.name" . }}
protocol: TCP
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path }}
port: {{ .Values.service.internalPort }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path }}
port: {{ .Values.service.internalPort }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
{{- range $configFile := (keys .Values.files) }}
- name: {{ template "retool.name" $ }}
mountPath: "/usr/share/retool/config/{{ $configFile }}"
subPath: {{ $configFile }}
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | indent 8 }}
{{- end }}
{{- with .Values.extraContainers }}
{{ tpl . $ | indent 6 }}
{{- end }}
{{- range .Values.extraConfigMapMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{ toYaml .Values.image.pullSecrets | indent 8 }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- if .Values.securityContext.enabled }}
securityContext:
runAsUser: {{ .Values.securityContext.runAsUser }}
fsGroup: {{ .Values.securityContext.fsGroup }}
{{- end }}
volumes:
{{- range .Values.extraConfigMapMounts }}
- name: {{ .name }}
configMap:
name: {{ .configMap }}
{{- end }}
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | indent 8 }}
{{- end }}