Skip to content

[Update] Nginx-Traefik compatibility #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions charts/tooljet/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,19 @@ Return the PostgreSQL Secret Name
{{- end }}

{{/*
Return the appropriate apiVersion for ingress.
Returns the correct ingress class name based on selected controller.
*/}}
{{- define "tooljet.ingress.apiVersion" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "extensions/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1" -}}
{{- end -}}
{{- end -}}
{{- define "tooljet.ingressClassName" -}}
{{- if .Values.ingress.ingressClassName }}
{{ .Values.ingress.ingressClassName }}
{{- else if eq .Values.ingress.type "nginx" }}
nginx
{{- else if eq .Values.ingress.type "traefik" }}
traefik
{{- else }}
nginx
{{- end }}
{{- end }}

{{/*
Return the appropriate apiVersion for autoscaling.
Expand Down
6 changes: 2 additions & 4 deletions charts/tooljet/templates/deployment-pgrst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ spec:
{{- if .Values.tooljetdb_external_postgresql.enabled }}
- name: PGRST_DB_URI
value: {{ .Values.tooljetdb_external_postgresql.PGRST_DB_URI }}
- name: PGRST_DB_PRE_CONFIG
value: postgrest.pre_config
{{- else }}
- name: PGRST_DB_PRE_CONFIG
value: postgrest.pre_config
- name: PGRST_DB_URI
value: {{ .Values.env.PGRST_DB_URI }}
{{- end }}
- name: PGRST_DB_PRE_CONFIG
value: postgrest.pre_config
- name: PGRST_DB_ANON_ROLE
value: postgres
- name: PGRST_JWT_SECRET
Expand Down
27 changes: 27 additions & 0 deletions charts/tooljet/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "tooljet.fullname" . }}-{{ .Values.ingress.type }}
labels:
{{- include "tooljet.labels" . | nindent 4 }}
annotations:
{{- toYaml (index .Values.ingress .Values.ingress.type).annotations | nindent 4 }}
spec:
ingressClassName: {{ (index .Values.ingress .Values.ingress.type).ingressClassName }}
rules:
- host: {{ (index .Values.ingress .Values.ingress.type).hostname }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "tooljet.fullname" . }}
port:
number: {{ .Values.apps.tooljet.service.port }}
{{- with (index .Values.ingress .Values.ingress.type).tls }}
tls:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
42 changes: 0 additions & 42 deletions charts/tooljet/templates/ingress.yml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/tooljet/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.apps.tooljet.secret.name }}
name: {{ .Values.apps.tooljet.secret.name | default "tooljet-server" }}
labels:
{{- include "tooljet.labels" . | nindent 4 }}
{{- include "tooljet.selectorLabels" . | nindent 4 }}
Expand Down
19 changes: 16 additions & 3 deletions charts/tooljet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ postgrest:

redis:
enabled: false
architecture: standalone # Use in case multiple tooljet pods running
fullnameOverride: redis
auth:
enabled: true
Expand All @@ -116,6 +117,18 @@ autoscaling:

ingress:
enabled: false
hostname: tooljet.localhost
ingressClassName: 'nginx'
tls: []
type: nginx # traefik

traefik:
hostname: tooljet.localhost
ingressClassName: traefik
tls: []
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure

nginx:
hostname: tooljet.localhost
ingressClassName: nginx
tls: []
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /