Skip to content

Commit 01bb485

Browse files
authored
Merge pull request #162 from tryretool/jatin/multiplayer_support
Support experimental multiplayer deployment.
2 parents a9c4696 + 80f7aee commit 01bb485

File tree

4 files changed

+255
-3
lines changed

4 files changed

+255
-3
lines changed

charts/retool/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: retool
33
description: A Helm chart for Kubernetes
44
type: application
5-
version: 6.1.1
5+
version: 6.1.2
66
maintainers:
77
- name: Retool Engineering
88
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
{{- if .Values.multiplayer.enabled }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ template "retool.fullname" . }}-multiplayer-ws
6+
spec:
7+
selector:
8+
retoolService: {{ template "retool.fullname" . }}-multiplayer-ws
9+
ports:
10+
- name: ws
11+
protocol: TCP
12+
port: 80
13+
targetPort: 3001
14+
---
15+
apiVersion: apps/v1
16+
kind: Deployment
17+
metadata:
18+
name: {{ template "retool.fullname" . }}-multiplayer-ws
19+
labels:
20+
{{- include "retool.labels" . | nindent 4 }}
21+
{{- if .Values.deployment.annotations }}
22+
annotations:
23+
{{ toYaml .Values.deployment.annotations | indent 4 }}
24+
{{- end }}
25+
spec:
26+
replicas: {{ .Values.multiplayer.replicaCount }}
27+
selector:
28+
matchLabels:
29+
retoolService: {{ include "retool.name" . }}-multiplayer-ws
30+
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
31+
template:
32+
metadata:
33+
annotations:
34+
{{- if .Values.podAnnotations }}
35+
{{ toYaml .Values.podAnnotations | indent 8 }}
36+
{{- end }}
37+
{{- if .Values.multiplayer.annotations }}
38+
{{ toYaml .Values.multiplayer.annotations | indent 8 }}
39+
{{- end }}
40+
labels:
41+
retoolService: {{ include "retool.name" . }}-multiplayer-ws
42+
{{- if .Values.podLabels }}
43+
{{ toYaml .Values.podLabels | indent 8 }}
44+
{{- end }}
45+
{{- if .Values.multiplayer.labels }}
46+
{{ toYaml .Values.multiplayer.labels | indent 8 }}
47+
{{- end }}
48+
spec:
49+
serviceAccountName: {{ template "retool.serviceAccountName" . }}
50+
{{- if .Values.priorityClassName }}
51+
priorityClassName: "{{ .Values.priorityClassName }}"
52+
{{- end }}
53+
{{- if .Values.initContainers }}
54+
initContainers:
55+
{{- range $key, $value := .Values.initContainers }}
56+
- name: "{{ $key }}"
57+
{{ toYaml $value | indent 8 }}
58+
{{- end }}
59+
{{- end }}
60+
containers:
61+
- name: {{ .Chart.Name }}
62+
image: "{{ .Values.image.repository }}:{{ required "Please set a value for .Values.image.tag" .Values.image.tag }}"
63+
imagePullPolicy: {{ .Values.image.pullPolicy }}
64+
args:
65+
- bash
66+
- -c
67+
- 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
68+
{{- if .Values.commandline.args }}
69+
{{ toYaml .Values.commandline.args | indent 10 }}
70+
{{- end }}
71+
env:
72+
- name: DEPLOYMENT_TEMPLATE_TYPE
73+
value: {{ template "retool.deploymentTemplateType" . }}
74+
- name: DEPLOYMENT_TEMPLATE_VERSION
75+
value: {{ template "retool.deploymentTemplateVersion" . }}
76+
- name: SERVICE_TYPE
77+
value: MULTIPLAYER_SERVICE
78+
- name: MULTIPLAYER_SERVER_PORT
79+
value: "3001"
80+
- name: COOKIE_INSECURE
81+
value: {{ .Values.config.useInsecureCookies | quote }}
82+
- name: POSTGRES_HOST
83+
value: {{ template "retool.postgresql.host" . }}
84+
- name: POSTGRES_PORT
85+
value: {{ template "retool.postgresql.port" . }}
86+
- name: POSTGRES_DB
87+
value: {{ template "retool.postgresql.database" . }}
88+
- name: POSTGRES_USER
89+
value: {{ template "retool.postgresql.user" . }}
90+
- name: POSTGRES_SSL_ENABLED
91+
value: {{ template "retool.postgresql.ssl_enabled" . }}
92+
- name: POSTGRES_PASSWORD
93+
valueFrom:
94+
secretKeyRef:
95+
{{- if .Values.postgresql.enabled }}
96+
name: {{ template "retool.postgresql.fullname" . }}
97+
key: postgres-password
98+
{{- else }}
99+
{{- if .Values.config.postgresql.passwordSecretName }}
100+
name: {{ .Values.config.postgresql.passwordSecretName }}
101+
key: {{ .Values.config.postgresql.passwordSecretKey | default "postgresql-password" }}
102+
{{- else }}
103+
name: {{ template "retool.fullname" . }}
104+
key: postgresql-password
105+
{{- end }}
106+
{{- end }}
107+
- name: ENCRYPTION_KEY
108+
valueFrom:
109+
secretKeyRef:
110+
{{- if .Values.config.encryptionKeySecretName }}
111+
name: {{ .Values.config.encryptionKeySecretName }}
112+
key: {{ .Values.config.encryptionKeySecretKey | default "encryption-key" }}
113+
{{- else }}
114+
name: {{ template "retool.fullname" . }}
115+
key: encryption-key
116+
{{- end }}
117+
- name: JWT_SECRET
118+
valueFrom:
119+
secretKeyRef:
120+
{{- if .Values.config.jwtSecretSecretName }}
121+
name: {{ .Values.config.jwtSecretSecretName }}
122+
key: {{ .Values.config.jwtSecretSecretKey | default "jwt-secret" }}
123+
{{- else }}
124+
name: {{ template "retool.fullname" . }}
125+
key: jwt-secret
126+
{{- end }}
127+
{{- range $key, $value := .Values.multiplayer.environmentVariables }}
128+
- name: "{{ $key }}"
129+
value: "{{ $value }}"
130+
{{- end }}
131+
resources:
132+
{{ toYaml .Values.multiplayer.resources | indent 10 }}
133+
readinessProbe:
134+
httpGet:
135+
path: /api/checkHealth
136+
port: 3001
137+
periodSeconds: 10
138+
livenessProbe:
139+
httpGet:
140+
path: /api/checkHealth
141+
port: 3001
142+
initialDelaySeconds: 100
143+
failureThreshold: 10
144+
timeoutSeconds: 10
145+
periodSeconds: 20
146+
volumeMounts:
147+
{{- range $configFile := (keys .Values.files) }}
148+
- name: {{ template "retool.name" $ }}
149+
mountPath: "/usr/share/retool/config/{{ $configFile }}"
150+
subPath: {{ $configFile }}
151+
{{- end }}
152+
{{if and .Values.persistentVolumeClaim.enabled .Values.persistentVolumeClaim.mountPath }}
153+
- name: retool-pv
154+
mountPath: {{ .Values.persistentVolumeClaim.mountPath }}
155+
{{- end }}
156+
{{- if .Values.extraVolumeMounts }}
157+
{{ toYaml .Values.extraVolumeMounts | indent 8 }}
158+
{{- end }}
159+
{{- with .Values.extraContainers }}
160+
{{ tpl . $ | indent 6 }}
161+
{{- end }}
162+
{{- range .Values.extraConfigMapMounts }}
163+
- name: {{ .name }}
164+
mountPath: {{ .mountPath }}
165+
subPath: {{ .subPath }}
166+
{{- end }}
167+
{{- if .Values.image.pullSecrets }}
168+
imagePullSecrets:
169+
{{ toYaml .Values.image.pullSecrets | indent 8 }}
170+
{{- end }}
171+
{{- if .Values.affinity }}
172+
affinity:
173+
{{ toYaml .Values.affinity | indent 8 }}
174+
{{- end }}
175+
{{- if .Values.nodeSelector }}
176+
nodeSelector:
177+
{{ toYaml .Values.nodeSelector | indent 8 }}
178+
{{- end }}
179+
tolerations:
180+
{{ toYaml .Values.tolerations | indent 8 }}
181+
{{- if .Values.securityContext.enabled }}
182+
securityContext:
183+
runAsUser: {{ .Values.securityContext.runAsUser }}
184+
fsGroup: {{ .Values.securityContext.fsGroup }}
185+
{{- end }}
186+
volumes:
187+
{{- range .Values.extraConfigMapMounts }}
188+
- name: {{ .name }}
189+
configMap:
190+
name: {{ .configMap }}
191+
{{- end }}
192+
{{- if .Values.persistentVolumeClaim.enabled }}
193+
- name: retool-pv
194+
persistentVolumeClaim:
195+
claimName: {{ default (include "retool.fullname" .) .Values.persistentVolumeClaim.existingClaim }}
196+
{{- end }}
197+
{{- if .Values.extraVolumes }}
198+
{{ toYaml .Values.extraVolumes | indent 8 }}
199+
{{- end }}
200+
{{- end }}

charts/retool/values.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ tolerations: []
267267
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
268268
nodeSelector: {}
269269

270-
# Common annotations for all pods (backend and job runner).
270+
# Common annotations for all pods.
271271
podAnnotations: {}
272272

273273
revisionHistoryLimit: 3
@@ -405,6 +405,32 @@ dbconnector:
405405
# This feature is not ready for production use; please check with the Retool team before enablement.
406406
enabled: false
407407

408+
multiplayer:
409+
# Enable this to use Retool's experimental multiplayer editing feature.
410+
# This feature is not ready for production use; please check with the Retool team before enablement.
411+
enabled: false
412+
413+
replicaCount: 1
414+
415+
# Resources for multiplayer pods
416+
resources:
417+
requests:
418+
cpu: "200m"
419+
memory: "256Mi"
420+
limits:
421+
memory: "2048Mi"
422+
423+
# Set environment variables for multiplayer pods, e.g. defining which origin to use
424+
# environmentVariables:
425+
# - name: MAIN_DOMAIN
426+
# value: retool.foo.com
427+
428+
# Annotations for multiplayer pods
429+
annotations: {}
430+
431+
# Labels for multiplayer pods
432+
labels: {}
433+
408434
codeExecutor:
409435
# enabled by default from Chart version 6.0.15 and Retool image 3.20.15 onwards
410436
# explicitly set other fields as needed

values.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ tolerations: []
267267
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
268268
nodeSelector: {}
269269

270-
# Common annotations for all pods (backend and job runner).
270+
# Common annotations for all pods.
271271
podAnnotations: {}
272272

273273
revisionHistoryLimit: 3
@@ -405,6 +405,32 @@ dbconnector:
405405
# This feature is not ready for production use; please check with the Retool team before enablement.
406406
enabled: false
407407

408+
multiplayer:
409+
# Enable this to use Retool's experimental multiplayer editing feature.
410+
# This feature is not ready for production use; please check with the Retool team before enablement.
411+
enabled: false
412+
413+
replicaCount: 1
414+
415+
# Resources for multiplayer pods
416+
resources:
417+
requests:
418+
cpu: "200m"
419+
memory: "256Mi"
420+
limits:
421+
memory: "2048Mi"
422+
423+
# Set environment variables for multiplayer pods, e.g. defining which origin to use
424+
# environmentVariables:
425+
# - name: MAIN_DOMAIN
426+
# value: retool.foo.com
427+
428+
# Annotations for multiplayer pods
429+
annotations: {}
430+
431+
# Labels for multiplayer pods
432+
labels: {}
433+
408434
codeExecutor:
409435
# enabled by default from Chart version 6.0.15 and Retool image 3.20.15 onwards
410436
# explicitly set other fields as needed

0 commit comments

Comments
 (0)