1. Deploy the ToolJet helm chart on Azure Managed Openshift Service


    To deploy the ToolJet Helm chart on an Azure Managed OpenShift Service using Pulumi, we will proceed in two main steps:

    1. Create an Azure OpenShift Managed Cluster using the azure-native.containerservice.OpenShiftManagedCluster Pulumi resource.
    2. Deploy the ToolJet Helm chart onto the cluster using the kubernetes.helm.v3.Chart Pulumi resource.

    Before you start, you should have Pulumi installed, be logged in to the Pulumi service, and have the appropriate cloud credentials set up to create resources in Azure.

    Here is a detailed breakdown of what we'll do in the Pulumi TypeScript program:

    • We'll first instantiate an OpenShift managed cluster in Azure. This will be our Kubernetes environment where we'll deploy the Helm chart.
    • Then we'll use the kubernetes package to connect to the created OpenShift cluster.
    • Using the connected Kubernetes provider, we'll deploy the ToolJet Helm chart to the cluster.

    Below is the TypeScript program that accomplishes these steps:

    import * as pulumi from '@pulumi/pulumi'; import * as azure_native from '@pulumi/azure-native'; import * as k8s from '@pulumi/kubernetes'; const config = new pulumi.Config(); const resourceName = 'openshift-cluster'; // Create an Azure resource group if it doesn't exist const resourceGroup = new azure_native.resources.ResourceGroup(resourceName, { resourceGroupName: resourceName, }); // Define the OpenShift Managed Cluster const openshiftCluster = new azure_native.containerservice.OpenShiftManagedCluster(resourceName, { resourceGroupName: resourceGroup.name, location: resourceGroup.location, openShiftVersion: '3.11', // specify the version you desire here networkProfile: { vnetCidr: '', }, masterPoolProfile: { count: 1, vmSize: 'Standard_DS3_v2', }, agentPoolProfiles: [{ name: 'agentpool', count: 3, vmSize: 'Standard_DS3_v2', role: 'compute', }], }); // Create a Kubernetes provider to deploy the Helm chart const k8sProvider = new k8s.Provider('k8sProvider', { kubeconfig: openshiftCluster.config.kubeconfigRaw, }); // Deploy ToolJet helm chart using the Pulumi Kubernetes Provider const toolJetChart = new k8s.helm.v3.Chart('tooljet', { chart: 'tooljet', version: 'x.y.z', // specify the chart version you desire here fetchOpts: { repo: 'https://helm.tooljet.io', // specify the Helm repository URL for ToolJet }, }, { provider: k8sProvider }); // Export the OpenShift Managed Cluster's kubeconfig export const kubeconfig = openshiftCluster.config.kubeconfigRaw; // Export the endpoint to access the ToolJet application export const toolJetEndpoint = toolJetChart.getResourceProperty('v1/Service', 'tooljet', 'status').apply(status => status.loadBalancer.ingress[0].ip);

    Let's go through this code:

    • We initialize a Pulumi program with necessary imports.
    • We create an Azure resource group using azure-native.resources.ResourceGroup. This functions as a logical container in which our OpenShift cluster and all related resources are stored.
    • We define an OpenShift Managed Cluster with the required properties such as location, version, and VM sizes for both master and agent nodes.
    • We create a Kubernetes provider that allows us to interact with our OpenShift cluster.
    • Using the created provider, we deploy the ToolJet Helm chart by specifying the chart name, version, and the Helm repository URL. If the ToolJet Helm chart has specific values you want to set, you can include a values field inside the Chart arguments and supply them as an object.
    • Finally, we export the kubeconfig for you to use with kubectl to interact with your cluster and the external IP for the ToolJet application service (assuming it creates a LoadBalancer service; if not, you might need to extract the appropriate endpoint differently based on how the chart exposes the application).

    You will need to replace the placeholder 'x.y.z' with the actual version of the ToolJet Helm chart you intend to deploy. You can find this in the official ToolJet Helm chart documentation or chart repository.

    Also, make sure you have the proper version for your OpenShift cluster and consider if you need to specify other configurations depending on your requirements.

    After writing this program into a .ts file, you can run the following commands to deploy the OpenShift cluster and the ToolJet Helm chart:

    pulumi up

    This command initiates the deployment process and will present you with a summary of the proposed changes before applying them. After reviewing the changes, you can proceed with the deployment.

    Remember that creating an OpenShift cluster might take some time, and it will incur costs on your Azure account. Also, always review the security best practices for exposing applications when deploying something new on the cloud.