Skip to content

Commit bf8897c

Browse files
author
Alexander Weber
authored
Adding HELM charts for installation in Kubernetes (ToolJet#2393)
* + added helm chart config * + db seed config * fixed (placeholder) HPA values to at least make sense * made service type configurable in values.yaml
1 parent be50abc commit bf8897c

File tree

9 files changed

+186
-0
lines changed

9 files changed

+186
-0
lines changed

deploy/helm/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
charts

deploy/helm/Chart.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: postgresql
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 11.1.3
5+
digest: sha256:e743082cbe5e81348abab399e199150a279f4b6b186e9af70f863cc95d22a1c5
6+
generated: "2022-03-01T14:35:37.761977+01:00"

deploy/helm/Chart.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v2
2+
name: tooljet
3+
description: none
4+
5+
type: application
6+
version: 1.2.2
7+
appVersion: "v1.2.2"
8+
9+
dependencies:
10+
- name: postgresql
11+
version: "11.1.3"
12+
repository: "https://charts.bitnami.com/bitnami"

deploy/helm/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Helm installation
2+
3+
This chart can be used to install ToolJet in a Kubernetes Cluster via [Helm v3](https://helm.sh).\
4+
This setup is very rudimentary and comes with an included PostgreSQL server out of the box.
5+
6+
## Installation
7+
8+
To install, follow these steps:
9+
10+
1) Clone the repo and `cd` into this directory
11+
2) Run `helm dependency update`
12+
3) Recommended but optional:\
13+
Patch the values in `values.yaml` file (usernames & passwords, persistence, ...).
14+
4) Run `helm install -n $NAMESPACE --create-namespace $RELEASE .`\
15+
You need to replace these variables with your configuration values.
16+
5) The database won't be seeded yet. For that, shell into the `tooljet` pod and run `npm run db:seed` in the `/app` folder. You can now login with user `[email protected]` and password `password`.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: tooljet
5+
spec:
6+
selector:
7+
matchLabels:
8+
app: tooljet
9+
template:
10+
metadata:
11+
labels:
12+
app: tooljet
13+
spec:
14+
containers:
15+
- name: tooljet
16+
image: "tooljet/tooljet-ce:{{ .Chart.AppVersion }}"
17+
imagePullPolicy: IfNotPresent
18+
args: ["npm", "run", "start:prod"]
19+
ports:
20+
- containerPort: 3000
21+
resources:
22+
limits:
23+
memory: {{ .Values.apps.tooljet.deployment.resources.limits.memory }}
24+
cpu: {{ .Values.apps.tooljet.deployment.resources.limits.cpu }}
25+
requests:
26+
memory: {{ .Values.apps.tooljet.deployment.resources.requests.memory }}
27+
cpu: {{ .Values.apps.tooljet.deployment.resources.requests.cpu }}
28+
readinessProbe:
29+
httpGet:
30+
port: 3000
31+
path: /api/health
32+
successThreshold: 1
33+
initialDelaySeconds: 10
34+
periodSeconds: 5
35+
failureThreshold: 6
36+
env:
37+
- name: TOOLJET_HOST
38+
value: "{{ .Values.apps.tooljet.service.host }}"
39+
- name: PG_HOST
40+
value: "{{ .Release.Name }}-postgresql"
41+
- name: PG_USER
42+
valueFrom:
43+
secretKeyRef:
44+
name: "{{ .Values.apps.tooljet.secret.name }}"
45+
key: pg_user
46+
- name: PG_PASS
47+
valueFrom:
48+
secretKeyRef:
49+
name: "{{ .Values.apps.tooljet.secret.name }}"
50+
key: pg_password
51+
- name: PG_DB
52+
valueFrom:
53+
secretKeyRef:
54+
name: "{{ .Values.apps.tooljet.secret.name }}"
55+
key: pg_db
56+
- name: LOCKBOX_MASTER_KEY
57+
valueFrom:
58+
secretKeyRef:
59+
name: "{{ .Values.apps.tooljet.secret.name }}"
60+
key: lockbox_key
61+
- name: SECRET_KEY_BASE
62+
valueFrom:
63+
secretKeyRef:
64+
name: "{{ .Values.apps.tooljet.secret.name }}"
65+
key: secret_key_base
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: autoscaling/v2beta1
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: tooljet
5+
spec:
6+
scaleTargetRef:
7+
apiVersion: apps/v1
8+
kind: Deployment
9+
name: tooljet
10+
minReplicas: {{ .Values.apps.tooljet.hpa.min }}
11+
maxReplicas: {{ .Values.apps.tooljet.hpa.max }}
12+
metrics:
13+
- type: Resource
14+
resource:
15+
name: cpu
16+
targetAverageValue: {{ .Values.apps.tooljet.hpa.threshhold.cpu }}
17+
- type: Resource
18+
resource:
19+
name: memory
20+
targetAverageValue: {{ .Values.apps.tooljet.hpa.threshhold.ram }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: "{{ .Values.apps.tooljet.secret.name }}"
5+
type: Opaque
6+
data:
7+
pg_user: {{ .Values.apps.tooljet.secret.data.pg_user | b64enc | quote }}
8+
pg_password: {{ .Values.apps.tooljet.secret.data.pg_password | b64enc | quote }}
9+
pg_db: {{ .Values.apps.tooljet.secret.data.pg_db | b64enc | quote }}
10+
lockbox_key: {{ .Values.apps.tooljet.secret.data.lockbox_key | b64enc | quote }}
11+
secret_key_base: {{ .Values.apps.tooljet.secret.data.secret_key_base | b64enc | quote }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: tooljet
5+
spec:
6+
type: {{ .Values.apps.tooljet.service.type }}
7+
ports:
8+
- port: 3000
9+
protocol: TCP
10+
targetPort: 3000
11+
selector:
12+
app: tooljet

deploy/helm/values.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apps:
2+
tooljet:
3+
service:
4+
type: ClusterIP
5+
host: "http://localhost"
6+
deployment:
7+
resources:
8+
requests:
9+
memory: 1024Mi
10+
cpu: 1
11+
limits:
12+
memory: 2048Mi
13+
cpu: 2
14+
hpa:
15+
min: 1
16+
max: 1
17+
threshhold:
18+
cpu: 0.75
19+
ram: 768Mi
20+
secret:
21+
name: tooljet-server
22+
data:
23+
pg_user: "postgresql"
24+
pg_password: "postgresql"
25+
pg_db: "tooljet"
26+
lockbox_key: "0123456789ABCDEF"
27+
secret_key_base: "0123456789ABCDEF"
28+
29+
postgresql:
30+
enabled: true
31+
postgresqlExtendedConf:
32+
maxConnections: 1024
33+
replication:
34+
enabled: false
35+
auth:
36+
# postgresPassword: "postgres"
37+
username: "postgresql"
38+
password: "postgresql"
39+
primary:
40+
persistence:
41+
enabled: true
42+
size: 8Gi
43+
storageClass: ""

0 commit comments

Comments
 (0)