Joget on Google Kubernetes Engine

Google Kubernetes Engine (GKE) is a managed, cloud-based service provided by Google Cloud that simplifies the deployment, scaling, and management of containerized applications using Google infrastructure. GKE is built on Kubernetes, an open-source container orchestration platform that automates application container deployment, scaling, and operations across clusters of hosts. 

If you are unfamiliar with Kubernetes, see Joget on Kubernetes for a quick introduction.

To Deploy Joget on GKE, follow the steps in the sections below.

Create a Kubernetes Cluster

First, you need to create a Kubernetes cluster. Follow the steps below to do so.

  1. Access the Google Kubernetes Engine console.
  2. On the Clusters page, click on the Create Cluster button.
  3. Adjust the cluster configuration as desired, or use the default values.
  4. Go to the Cluster Basics tab.
  5. Configure the name, zone, and Kubernetes version for the cluster.
    Take note of the Zone used, which will be used for storage configuration later.
  6. Go to the Node Pools > default-pool tab.
  7. Configure the number of nodes and scaling options.
  8. Go to the Nodes tab.
  9. Choose the machine configuration to specify the machine type, CPU, and disk options.

  10. Click CREATE at the bottom to start creating the cluster.

Now that the cluster has been created, you will see a tick next to the cluster name, and a Connect button will appear next to it on the clusters list, allowing you to establish a connection with the newly created cluster.

Deploy MariaDB database

Now that you have a running cluster, you will need to deploy a database to be used by the Joget platform. In this case, we will use a MariaDB database in the Google Cloud Marketplace. Follow the steps below to do so.

  1. Go to the Applications tab.
  2. Click Deploy from Marketplace.
  3. Search for MariaDB and click on the MariaDB entry.

  4. Click CONFIGURE.
  5. Change the configuration or use the default values.
  6.  Click Deploy. Wait for a few minutes while the MariaDB instance is starting.

  7. Once the status is OK, click on the name and view the details.
  8. Under Details, look for the MariaDB root password and click Preview secret data
    Copy the database root password and service name for the database setup later.

Deploy Google Cloud filestore persistent volume

If you are running a multiple-node Kubernetes cluster, you will need to allocate shared persistent storage with read-write access by multiple nodes. For this purpose, you can use Google Cloud Filestore, a fully managed storage service. Follow the steps below to do so.

  1. Access the Google Cloud Filestore console. The first time you access it, you must click the Enable button.

  2. In the Instances tab, click on the Create Instance button.
  3. On the Create an Instance page, fill out the fields:
    • Instance ID: joget-storage
    • File Share Name: volume1
    • Region/Zone: Choose your zone
      The Filestore instance must be in the same zone as your Kubernetes cluster for it to be accessible to the cluster.

  4. Click Create to initialize the instance.
    Save the IP address and File share name for use later.

Deploy Joget DX

Now that the database and persistent storage are available, you can deploy Joget.  Follow the steps below to do so.

  1. Download the joget-dx8-tomcat9-gke.yaml YAML file.
  2. Open the YAML file and locate the PersistentVolume and modify it to match the Filestore settings for the path (file share name) and server (IP address).
     path: /volume1 # change to match the Filestore instance file share name
     server: 10.255.140.178 # change to match the IP address of the Filestore instance
  3. Open your web browser and go to the Google Kubernetes Engine console.
  4. Access the Clusters tab.
  5. Click the Connect button for your cluster.
  6. Click Run in Cloud Shell


  7. Once you have access to the Cloud Shell command line, use your favorite editor (e.g., vi or nano) to save your YAML into a file.
  8. You can then apply the YAML using the kubectl command.
    kubectl apply -f joget-dx8-tomcat9-gke.yaml

  9. After running the command, wait a few minutes for the necessary Kubernetes objects (Deployment, PersistentVolume, PersistentVolumeClaim, Deployment, Service, and ClusterRoleBinding) to be created for the Joget deployment.

Once finished, you can access the Services & Ingress tab and see an External load balancer service with a corresponding Endpoint URL. Click it to access Joget.

Set up a database

To complete the Joget deployment, you need to perform a one-time Set Up a Database. Input the previously created MariaDB service name in the Database Host and its root password in the Database Password fields.

Once the setup is complete, click on Done and you will be brought to the Joget App Center.

Scale deployment

To scale the number of pods running Joget, you can use the GKE console. Follow the steps below to do so.

  1. Open your web browser and go to the Google Kubernetes Engine console.
  2. Access the Workloads tab.
  3. Choose the Joget deployment.
  4. On the Deployment details header, select Actions > Scale.
  5. Input the required number of replicas (pods) that you require.
  6. Click Scale.

The desired number of pods will initialize and startup. These instances will have session replication configured so load can be balanced between them, and transparent failover will happen in the event of failure.

Sample Deployment YAML

# Example YAML for Google Kubernetes Engine (GKE) deployment using Google Cloud Filestore as persistent volume
# https://cloud.google.com/filestore/docs/accessing-fileshares
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: fileserver
spec:
  capacity:
    storage: 1Ti
  accessModes:
  - ReadWriteMany
  nfs:
    path: /volume1 # change to match the Filestore instance file share name
    server: 10.145.99.42 # change to match the IP address of the Filestore instance
---   
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: joget-dx8-tomcat9-pvc
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  volumeName: fileserver
  resources:
    requests:
      storage: 100Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: joget-dx8-tomcat9
  labels:
    app: joget-dx8-tomcat9
spec:
  replicas: 1
  selector:
    matchLabels:
      app: joget-dx8-tomcat9
  template:
    metadata:
      labels:
        app: joget-dx8-tomcat9
    spec:
      volumes:
        - name: joget-dx8-tomcat9-pv
          persistentVolumeClaim:
            claimName: joget-dx8-tomcat9-pvc
            readOnly: false
      initContainers:
        - name: init-volume
          image: busybox:1.28
          command: ['sh', '-c', 'chmod -f -R g+w /opt/joget/wflow; exit 0']
          volumeMounts:
            - name: joget-dx8-tomcat9-pv
              mountPath: "/opt/joget/wflow"
      containers:
        - name: joget-dx8-tomcat9
          image: jogetworkflow/joget-dx8-tomcat9:latest
          ports:
            - containerPort: 8080
          volumeMounts:
            - name: joget-dx8-tomcat9-pv
              mountPath: /opt/joget/wflow
          env:
            - name: KUBERNETES_NAMESPACE
              valueFrom:
                fieldRef:
                    fieldPath: metadata.namespace
---
apiVersion: v1
kind: Service
metadata:
  name: joget-dx8-tomcat9
  labels:
    app: joget-dx8-tomcat9
spec:
  ports:
  - name: http
    port: 80
    targetPort: 8080
  - name: https
    port: 443
    targetPort: 9080 
  selector:
    app: joget-dx8-tomcat9
  type: LoadBalancer
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: joget-dx8-tomcat9-clusterrolebinding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: view
subjects:
  - kind: ServiceAccount
    name: default
    namespace: default
Created by Marcos Last modified by Aadrian on Dec 13, 2024