Skip to content

Commit

Permalink
[fix] Add default multiplayer ingress rule (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlgao authored Feb 18, 2025
1 parent fb753bf commit 9a3c6ff
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/retool/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: retool
description: A Helm chart for Kubernetes
type: application
version: 6.3.5
version: 6.3.6
maintainers:
- name: Retool Engineering
email: [email protected]
Expand Down
28 changes: 28 additions & 0 deletions charts/retool/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ spec:
- host: {{ .Values.ingress.hostName | quote }}
http:
paths:
# The multiplayer paths must be added before the main path to avoid less specific paths being matched first.
{{- if ( and ((.Values.multiplayer).enabled) (((.Values.multiplayer).ingress).enabled) ) }}
{{- range .Values.multiplayer.ingress.paths }}
- path: {{ .path }}
{{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.Version) }}
pathType: {{ .pathType | default "ImplementationSpecific" }}
{{- end }}
backend:
service:
name: {{ template "retool.multiplayer.name" . }}
port:
number: {{ .port }}
{{- end }}
{{- end }}
- path:
{{- if and $pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.Version) }}
pathType: {{ $pathType }}
Expand All @@ -51,6 +65,20 @@ spec:
paths:
{{- with .extraPaths }}
{{ toYaml . | indent 10 }}
{{- end }}
# The multiplayer paths must be added before the main path to avoid less specific paths being matched first.
{{- if ( and (($.Values.multiplayer).enabled) ((($.Values.multiplayer).ingress).enabled) ) }}
{{- range (($.Values.multiplayer).ingress).paths }}
- path: {{ .path }}
{{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.Version) }}
pathType: {{ .pathType | default "ImplementationSpecific" }}
{{- end }}
backend:
service:
name: {{ template "retool.multiplayer.name" . }}
port:
number: {{ .port }}
{{- end }}
{{- end }}
{{- range .paths }}
- path: {{ .path }}
Expand Down
8 changes: 8 additions & 0 deletions charts/retool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,14 @@ multiplayer:
# Labels for multiplayer pods
labels: {}

# Paths to route to multiplayer pods; defaults to /api/multiplayer. Can specify both path and port.
ingress:
# This conditional is dependent on multiplayer.enabled.
enabled: true
paths:
- path: /api/multiplayer
port: 80

codeExecutor:
# enabled by default from Chart version 6.0.15 and Retool image 3.20.15 onwards
# explicitly set other fields as needed
Expand Down
8 changes: 8 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,14 @@ multiplayer:
# Labels for multiplayer pods
labels: {}

# Paths to route to multiplayer pods; defaults to /api/multiplayer. Can specify both path and port.
ingress:
# This conditional is dependent on multiplayer.enabled.
enabled: true
paths:
- path: /api/multiplayer
port: 80

codeExecutor:
# enabled by default from Chart version 6.0.15 and Retool image 3.20.15 onwards
# explicitly set other fields as needed
Expand Down

0 comments on commit 9a3c6ff

Please sign in to comment.