Skip to content

Commit

Permalink
[Docs] Deploying to k8s & Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
Navaneeth-pk committed Aug 1, 2021
1 parent 1f8fe20 commit f5ceec8
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 21 deletions.
24 changes: 24 additions & 0 deletions docker/server.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:14.17.0-buster

# Fix for JS heap limit allocation issue
ENV NODE_OPTIONS="--max-old-space-size=2048"

RUN apt update && apt install -y \
build-essential \
postgresql \
freetds-dev

RUN mkdir -p /app
WORKDIR /app
ENV NODE_ENV=production

# Building ToolJet server
COPY ./server/package.json ./server/package-lock.json ./server/
RUN npm --prefix server install
COPY ./server/ ./server/
RUN npm install -g @nestjs/cli
RUN npm --prefix server run build

COPY ./docker/ ./docker/

RUN ["chmod", "755", "./server/entrypoint.sh"]
12 changes: 7 additions & 5 deletions docs/docs/deployment/heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@ sidebar_position: 2
sidebar_label: Heroku
---

# Deploying ToolJet server on Heroku
# Deploying ToolJet on Heroku

Follow the steps below to deploy ToolJet ( both server & client ) on Heroku:
Follow the steps below to deploy ToolJet on Heroku:

1. Click the button below to start one click deployment.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/tooljet/tooljet/tree/main)

2. Navigate to Heroku dashboard and go to resources tab to verify that the dyno is turned on.
3. Go to settings tab on Heroku dashboard and select 'reveal config vars' to configure additional environment variables that your installation might need. ( Read [environment variables reference](/docs/deployment/env-vars) )
3. Go to settings tab on Heroku dashboard and select `reveal config vars` to configure additional environment variables that your installation might need.

Read [environment variables reference](/docs/deployment/env-vars)
4. Open the app.
5. The default username of the admin is dev@tooljet.io and password is password.
5. The default username of the admin is dev@tooljet.io and password is `password`.

:::tip
The one click deployment will create a free dyno and a free postgresql database.
:::

:::tip
ToolJet server and client are standalone applications. If you do not want to deploy the client on Heroku, modify `package.json` accordingly.
ToolJet server and client can be deployed as standalone applications. If you do not want to deploy the client on Heroku, modify `package.json` accordingly. We have a [guide](http://localhost:3001/docs/deployment/client) on deploying ToolJet client using services such as Firebase.
:::
36 changes: 20 additions & 16 deletions docs/docs/deployment/kubernetes.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
---
sidebar_position: 4
sidebar_label: Kubernetes
---

# Kubernetes
# Deploying ToolJet on Kubernetes

:::info
You should setup a PostgreSQL database manually to be used by the ToolJet server.
You should setup a PostgreSQL database manually to be used by ToolJet.
:::

Follow the steps below to deploy ToolJet server on a Kubernetes cluster.
Follow the steps below to deploy ToolJet on a Kubernetes cluster.

1. Setup a PostgreSQL database.
1. Setup a PostgreSQL database
ToolJet uses a postgres database as the persistent storage for storing data related to users and apps. We do not have plans to support other databases such as MySQL.

2. Create a Kubernetes secret with name `server`. For the minimal setup, ToolJet requires `pg_host`, `pg_db`, `pg_user`, `pg_password`, `secret_key_base` & `lockbox_key` keys in the secret. ( Read [environment variables reference](/docs/deployment/env-vars) )
2. Create a Kubernetes secret with name `server`. For the minimal setup, ToolJet requires `pg_host`, `pg_db`, `pg_user`, `pg_password`, `secret_key_base` & `lockbox_key` keys in the secret.

Read [environment variables reference](/docs/deployment/env-vars)

3. Create a Kubernetes deployment

```bash
$ kubectl apply -f https://raw.githubusercontent.com/ToolJet/ToolJet/main/deploy/kubernetes/server-deployment.yaml
```
```bash
$ kubectl apply -f https://raw.githubusercontent.com/ToolJet/ToolJet/main/deploy/kubernetes/deployment.yaml
```

:::info
The file given above is just a template and might not suit production environments. You should download the file and configure parameters such as the replica count and environment variables according to your needs.
:::
:::info
The file given above is just a template and might not suit production environments. You should download the file and configure parameters such as the replica count and environment variables according to your needs.
:::

4. Verify if the server is running
4. Verify if ToolJet is running

```bash
$ kubectl get pods
```
```bash
$ kubectl get pods
```

5. Create a Kubernetes services to publish the Kubernetes deployment that you've created. This step varies with cloud providers. We have a [template](https://raw.githubusercontent.com/ToolJet/ToolJet/main/deploy/kubernetes/server-service.yaml) for exposing the ToolJet server as a service using an AWS loadbalancer.
Examples:
Application load balancing on Amazon EKS: https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html
GKE Ingress for HTTP(S) Load Balancing: https://cloud.google.com/kubernetes-engine/docs/concepts/ingress
:::tip
Once the server is deployed, you can deploy ToolJet client on the provider of your choice. Please read the client deployment documentation [here](/docs/setup/client).
If you want to serve ToolJet client from services such as Firebase or Netlify, please read the client deployment documentation [here](/docs/setup/client).
:::

0 comments on commit f5ceec8

Please sign in to comment.