1. Deploy the tt-workflow-driver helm chart on Opensshift


    In order to deploy a Helm chart on an OpenShift cluster using Pulumi, you will need to follow a series of steps which include setting up the appropriate Pulumi provider for Kubernetes and utilizing the Helm Chart resource.

    The kubernetes.helm.v3.Chart resource allows you to specify the Helm Chart you want to deploy, along with options such as chart values or specific version. The essential properties of this resource include chart which is the name of the chart, and values, a set of configuration values for the chart, which can be overridden.

    The following program in TypeScript outlines how to deploy the tt-workflow-driver Helm chart on an OpenShift cluster. Before you can apply this program, ensure that you have the OpenShift cluster running and you have configured kubectl to interact with the cluster. The Pulumi Kubernetes provider uses the kubectl configuration to interact with your OpenShift cluster.

    Now, let's go through the program:

    1. A new instance of kubernetes.helm.v3.Chart is declared, specifying the chart name and any additional configurations needed for tt-workflow-driver.

    2. The values property can be used to override chart values based on your requirements.

    3. If your Helm chart is hosted in a custom Helm repository, you might need to use the repositoryOpts property to specify the repository details.

    Please replace "YOUR_NAMESPACE" with the namespace where you want to deploy your chart on the OpenShift cluster.

    import * as k8s from "@pulumi/kubernetes"; // Create an instance of the kubernetes provider connected to the desired OpenShift cluster. const openshiftProvider = new k8s.Provider("openshift", { // You would specify the kubeconfig file path of your OpenShift cluster here kubeconfig: "<your-kubeconfig-file-path>", }); // Deploy the tt-workflow-driver Helm chart to the OpenShift cluster. const ttWorkflowDriverChart = new k8s.helm.v3.Chart("tt-workflow-driver", { repo: "myhelmrepo", // Replace with the name of the repository hosting your chart. chart: "tt-workflow-driver", // The name of your chart. version: "1.2.3", // Optionally, specify a chart version. namespace: "YOUR_NAMESPACE", // Replace with the target namespace in your OpenShift cluster. values: { // Here you would specify key-value pairs according to your chart's `values.yaml` contents. // e.g. // service: { // type: "ClusterIP" // }, }, }, { provider: openshiftProvider }); // Export the URL through which the deployed application can be accessed. export const applicationUrl = ttWorkflowDriverChart.getResourceProperty("v1/Service", "tt-workflow-driver-service", "status").apply(status => { if (status.loadBalancer.ingress && status.loadBalancer.ingress[0]) { return status.loadBalancer.ingress[0].ip || status.loadBalancer.ingress[0].hostname; } else { return "Not available"; } });

    In this example:

    • We import the Kubernetes module from Pulumi.
    • We set up a new Kubernetes provider for OpenShift by passing kubeconfig data that allows Pulumi to communicate with your cluster securely.
    • We deploy your tt-workflow-driver Helm chart to the specified namespace. You'll need to fill in the values to match with what your chart expects.
    • We attempt to export the URL of the service created by the Helm chart, assuming it provisions a LoadBalancer type of service. If not, you may need to adjust the logic to match the expected output of your Helm chart or the way you expose services in OpenShift (such as using Routes).

    Do note that if you have not installed tt-workflow-driver Helm chart before, you will need to add the Helm chart repository that contains the chart to your development environment using the following Helm CLI command:

    helm repo add myhelmrepo <url-of-helm-repository>

    Replace <url-of-helm-repository> with the actual URL to the repository that hosts your Helm chart.

    After you have set up the program, you can deploy it using the Pulumi CLI by running pulumi up. This command will perform a preview first, and you will need to confirm the deployment by selecting yes when prompted.