Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
English |
---|
This article provides a tutorial on deploying, running and scaling Joget on Azure Kubernetes Service (AKS). AKS is a managed Kubernetes service offered by Azure. |
Info |
---|
If you are not familiar with Kubernetes, refer to Joget on Kubernetes for a quick introduction. |
...
From the Azure portal, go to the Kubernetes services then Create a Kubernetes cluster.
In the Basics page, choose the Subscription, Resource Group and input the Kubernetes cluster name. Adjust the other configuration settings as desired, or leave as default.
In the Node pools tab, you can configure to add node pools into the cluster. Read on multiple node pools in AKS. For this guide, we will use a single node configuration.
For other tab options - Access, Networking, Integrations, Advanced and Tags, you can leave the default options or make adjustments/changes as necessary. After that, you can click on the Review + create and deploy the Kubernetes cluster.
When the resource has completed their deployment, you can then connect to the cluster (read here) using Azure CLI/Azure Cloud Shell.
...
Code Block |
---|
kubectl describe deployment mysql kubectl get pods -l app=mysql kubectl describe pvc mysql-pv-claim |
You need to modify the original yaml files for production usage (eg. using different version of MySQL image and setting up secret instead of plain password in the yaml).
...
Code Block | ||
---|---|---|
| ||
#!/bin/bash # This script should be executed on Linux Ubuntu Virtual Machine EXPORT_DIRECTORY=${1:-/export/data} DATA_DIRECTORY=${2:-/data} AKS_SUBNET=${3:-*} echo "Updating packages" apt-get -y update echo "Installing NFS kernel server" apt-get -y install nfs-kernel-server echo "Making data directory ${DATA_DIRECTORY}" mkdir -p ${DATA_DIRECTORY} echo "Making new directory to be exported and linked to data directory: ${EXPORT_DIRECTORY}" mkdir -p ${EXPORT_DIRECTORY} echo "Mount binding ${DATA_DIRECTORY} to ${EXPORT_DIRECTORY}" mount --bind ${DATA_DIRECTORY} ${EXPORT_DIRECTORY} echo "Giving 777 permissions to ${EXPORT_DIRECTORY} directory" chmod 777 ${EXPORT_DIRECTORY} parentdir="$(dirname "$EXPORT_DIRECTORY")" echo "Giving 777 permissions to parent: ${parentdir} directory" chmod 777 $parentdir echo "Appending bound directories into fstab" echo "${DATA_DIRECTORY} ${EXPORT_DIRECTORY} none bind 0 0" >> /etc/fstab echo "Appending localhost and Kubernetes subnet address ${AKS_SUBNET} to exports configuration file" echo "/export ${AKS_SUBNET}(rw,async,insecure,fsid=01000,crossmnt,no_subtree_check)" >> /etc/exports echo "/export localhost(rw,async,insecure,fsid=01000,crossmnt,no_subtree_check)" >> /etc/exports nohup service nfs-kernel-server restart |
...
Code Block |
---|
kubectl apply -f azurenfsstorage.yaml |
...
You can then check the deployment progress from the Azure portal. (Or use kubectl commands eg. kubectl get deployment joget-dx7-tomcat9)
...
Code Block |
---|
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm repo update helm install ingress-nginx ingress-nginx/ingress-nginx --create-namespace --namespace nginx-ingress |
Install using yaml file
...
Code Block |
---|
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.4.0/deploy/static/provider/cloud/deploy.yaml |
After the Ingress Controller has been deployed, we can then apply the Ingress yaml so that we can access the Joget application externally.
...
Code Block | ||
---|---|---|
| ||
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: joget-dx7-tomcat9-ingress annotations: nginx.ingress.kubernetes.io/affinity: cookie nginx.ingress.kubernetes.io/ssl-redirect: "false" spec: ingressClassName: nginx rules: - http: paths: - path: /jw pathType: Prefix backend: service: name: joget-dx7-tomcat9 port: number: 8080 |
After the Ingress deployment is completed, you can get the public IP from the Kubernetes resources > Services and Ingresses pane in the Azure portal (eg. http://<external-ip>/jw).
...
To complete the Joget deployment, you need to perform a one-time Database Setup. Key in the MySQL service name and the Database Username and Password. Click on Save.
Once the setup is complete, click on Done and you will be brought to the Joget App Center.
...
Code Block | ||
---|---|---|
| ||
apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: letsencrypt-staging spec: acme: # The ACME server URL server: https://acme-staging-v02.api.letsencrypt.org/directory # Email address used for ACME registration email: [update email here] # Name of a secret used to store the ACME account private key privateKeySecretRef: name: letsencrypt-staging # Enable the HTTP-01 challenge provider solvers: - http01: ingress: class: nginx |
Code Block |
---|
kubectl apply -f stagingissuer.yaml |
...
Code Block | ||
---|---|---|
| ||
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: joget-dx7-tomcat9-ingress annotations: nginx.ingress.kubernetes.io/affinity: cookie nginx.ingress.kubernetes.io/ssl-redirect: "true" cert-manager.io/cluster-issuer: "letsencrypt-prod" spec: ingressClassName: nginx tls: - hosts: - exampledomain.com secretName : aks-jogetworkflow rules: - host: exampledomain.com - http: paths: - path: /jw pathType: Prefix backend: service: name: joget-dx7-tomcat9 port: number: 9080 |
...
While you can set the nodes or pods to autoscale in AKS (read here), you can also scale the number of nodes or pods manually. To scale the number of pods running Joget, you can use the kubectl command.
Code Block |
---|
kubectl scale –replicas--replicas=3 deployment/joget-dx7-tomcat9 |
Adjust the replica number as you desired and the desired number of pods will initialize and startup.
As for the node, you can scale the node count of the node pool from the Azure portal. Go to the Cluster in the Kubernetes service (in this guide example jogetakscluster) > Settings > Node pools. Select the node pool and then click on the Scale node pool. Choose Manual as the Scale method and input the desired node count (maximum available resource is based on the VM size that you have chosen).
This additional note is to guide on how to configure Joget in AKS connecting to the Azure Database for MySQL. It is based on the Azure guide here which has been modified to use the Joget application. This guide uses the Azure portal as to assist in visual guidance.
Assuming that a resource group has been created, then from the Azure portal, go to the Virtual network services then Create virtual network and also the subnets for the MySQL and AKS resources.
Info |
---|
Based on the Microsoft recommendations of using Azure CNI to setup the configuration of AKS and Azure DB. You can read more on the AKS networking best practises here. |
Then add the IP address space for the Virtual network.
After that create 2 subnets for the MySQL resource and also the AKS cluster.
We can then create the Virtual network resource.
Search for resource Azure Database for MySQL flexible servers. Then click on Create → Flexible server.
In the Basics tab, we configured as below since we are testing the resource. Modify as needed (also note in the screenshot the MySQL version is 5.7, we have tested with version 8 also).
Then in the Networking tab, we need configure the resource to use the Virtual network that we created earlier.
For Security and Tags tabs we can leave as default or make changes as necessary. After done we can create the resource.
For testing purpose, after the MySQL resource has been created, we turned off the require_secure_transport parameter. This is so that we will be able to intialise through the Joget setup page. Should you need this parameter to be enabled, you can then edit the app_datasource-<profile>.properties file. Example of the workflowUrl parameter with the require_secure_transport parameter turned on;
Code Block | ||
---|---|---|
| ||
workflowUrl=jdbc\:mysql\://<azuredburlhere>\:3306/jwdb?characterEncoding\=UTF-8&useSSL\=true&allowPublicKeyRetrieval\=true |
As to deploying the AKS cluster and Joget itself, the steps are similar as above in this KB page. The only different part is when setting up the AKS cluster, in the Networking tab, we need to specify to use Azure CNI and associate the virtual network and subnet that we have created earlier.
After AKS and Joget have been deployed, we will be able to do the DB setup on Joget.