1. Deploy the micro-integrator helm chart on Oracle Kubernetes Engine (OKE)


    In order to deploy a Helm chart, particularly the Micro Integrator Helm chart on Oracle Kubernetes Engine (OKE), you will need to complete a few steps:

    1. Set up Oracle Kubernetes Engine: You must have an OKE cluster running. This step is outside of the scope of the Pulumi program, but you can automate the creation of OKE clusters using the oci.ContainerEngine.Cluster resource.

    2. Install the Helm CLI: Pulumi's kubernetes.helm.v3.Chart resource assumes that Helm CLI is installed and configured on the machine running Pulumi.

    3. Write the Pulumi program: You'll be using the kubernetes.helm.v3.Chart resource type from the kubernetes package to deploy the Helm chart.

      • The Chart resource manages a Helm chart's deployment to Kubernetes.
      • It's beneficial to use Helm as it simplifies deploying complex applications as a single set of resources.

    Pulumi Program to Deploy the Micro Integrator Chart on OKE

    The following TypeScript program demonstrates how to deploy a Helm chart to an existing OKE cluster. Make sure that you have configured Pulumi to use the correct Kubernetes context, which should point to your OKE cluster.

    import * as kubernetes from "@pulumi/kubernetes"; // Step 1: Create a reference to your existing OKE cluster // You will have to replace 'okeKubeconfig' with a way to fetch your cluster's kubeconfig const okeKubeconfig = "..."; // Replace with your kubeconfig for the OKE cluster // Step 2: Use this kubeconfig to create a Provider resource pointing to the OKE cluster const okeProvider = new kubernetes.Provider("okeK8s", { kubeconfig: okeKubeconfig, }); // Step 3: Deploy the Micro Integrator Helm chart using Pulumi. // Replace 'chartVersion' with the specific version of the chart you want to deploy // and 'releaseName' with the name you want to give to your Helm release. const chartVersion = "1.2.3"; // Replace with the version of Micro Integrator chart to deploy const releaseName = "micro-integrator-release"; // Release name for the Helm chart const microIntegratorChart = new kubernetes.helm.v3.Chart(releaseName, { chart: "wso2/micro-integrator", version: chartVersion, fetchOpts: { repo: "https://wso2.github.io/charts", // Official WSO2 Helm chart repository }, }, { provider: okeProvider }); // Export the status of the Micro Integrator deployment export const microIntegratorStatus = microIntegratorChart.status;

    This program should be placed in a file such as index.ts. You also need to have the Pulumi CLI installed and be logged in.

    Explanation of the Program

    • Provider Configuration: A Kubernetes provider is instantiated with the kubeconfig of the OKE cluster. This tells Pulumi to perform operations on that particular Kubernetes cluster.

    • Helm Chart Deployment: kubernetes.helm.v3.Chart is used to deploy the Micro Integrator Helm chart. The chart property is assigned the name of the chart (wso2/micro-integrator), and the version property is the version number of the Helm chart that you wish to deploy. Set the fetchOpts.repo property to the URI of the Helm repository where the chart is stored.

    • Export: The status of the Helm release is exported, providing information that can be used to understand the deployment status.

    Running the Program

    Before running the program, ensure that:

    1. Pulumi is installed: Install Pulumi CLI and set up the Pulumi project.
    2. OCI CLI is configured: Ensure that Oracle Cloud Infrastructure CLI is set up and configured with appropriate credentials.
    3. Helm CLI is installed: Ensure that the Helm CLI is installed as Pulumi will use it to manage Helm chart lifecycle operations.
    4. Kubernetes Cluster: Make sure your Kubernetes cluster in OKE is running and available.

    With Pulumi and dependencies ready, you can execute the program by running:

    pulumi up

    This command will provision your Helm chart on the OKE cluster, following the specification outlined in index.ts. If successful, it will output the deployed resources including the Micro Integrator release status.