Joget DX on Apache Tomcat and PostgreSQL on K8s
- The PostgreSQL JDBC driver
- The deployment of PostgreSQL using Helm on K8s
- The configuration of Joget to utilize this database
- Creating the database
- Importing an SQL script
- How to configure and restart the Joget service
See the following sections for more details.
Create Joget image with PostgreSQL JDBC driver
Customize a Docker image for Joget DX to include the JDBC driver necessary for connecting to PostgreSQL. To do so, follow these steps:
- Create a Dockerfile that starts from a base image of Joget DX and copies the PostgreSQL JDBC driver to the corresponding Tomcat folder.
- Built the image using the docker build command.
- Upload it to a repository with the docker push command.
Deploy PostgreSQL on K8s using Helm
To deploy PostgreSQL in your Kubernetes environment using Helm, a package manager for K8s, execute the following commands:
Create PostgreSQL database
This code snippet enables users to create a PostgreSQL database for storing and managing data in their platform (application or system built or implemented using Joget). It sets a password to access PostgreSQL and executes a command to create a new database named "jwdb". Upon running the command, users exit the psql environment. Users must execute this code to configure the PostgreSQL database on the platform.
Import Joget DB SQL
When this command is executed, it sends the content of the SQL file named jwdb-postgresql-dx8.pgsql
to the PostgreSQL pod. Subsequently, it utilizes the previously set PostgreSQL password to authenticate the connection and executes the psql command to insert the script's content into the "jwdb" database. This process initializes the database with the schema and data necessary for the operation of the Joget platform.
Deploy Joget
To deploy Joget, follow the instructions provided at Joget on Kurbenetes, but ensure to replace the jogetworkflow/joget-dx8-tomcat9
image with the custom image quay.io/replaceWithYourAccount/joget-dx8-postgresql-tomcat9
in the YAML file as instructed.
Configure Joget datasource for PostgreSQL
These commands allow Joget users to configure Joget's connection with a PostgreSQL database. Creating and defining the appropriate configuration files within the Tomcat container sets the necessary parameters for Joget to interact correctly with the PostgreSQL database. This enables efficient management and utilization of data in applications and systems built with Joget.
Restart Joget
These commands allow you to restart the Joget instance to apply changes or troubleshoot issues. The instance is restarted by scaling the replica count of the Joget deployment to zero and then back to one. Additionally, by viewing the deployment logs, users can monitor the process and verify if the changes have been successfully applied.