1. Deploy the workload-launcher helm chart on Oracle Kubernetes Engine (OKE)


    To deploy the workload-launcher Helm chart on an Oracle Kubernetes Engine (OKE) cluster using Pulumi, we will follow these steps:

    1. Set up the OKE cluster itself using the oci.ContainerEngine.Cluster resource.
    2. Deploy the Helm chart onto the cluster using Pulumi's Helm support via the kubernetes.helm.sh/v3.Chart resource.

    Let's begin by installing the Pulumi CLI and setting up our working environment for TypeScript. You will need Node.js and npm installed to work with TypeScript. Pulumi CLI can be installed following the instructions on the Pulumi Getting Started guide.

    Once you have Pulumi CLI set up, you can create a new project named oke-helm-deployment with the following commands:

    pulumi new typescript -n oke-helm-deployment -d "Deploy Helm chart on OKE" cd oke-helm-deployment

    As part of the project setup, you'll be prompted to log in to the Pulumi service. After logging in, install the necessary npm packages:

    npm install @pulumi/oci @pulumi/kubernetes

    You'll also need to have the Oracle Cloud Infrastructure (OCI) CLI configured with the necessary credentials.

    Now let's write the Pulumi program that will deploy the necessary infrastructure:

    import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Create an Oracle Kubernetes Engine (OKE) cluster const okeCluster = new oci.ContainerEngine.Cluster("myOkeCluster", { // Specify the compartment ID where you want to create the cluster compartmentId: "ocid1.compartment.oc1..exampleuniqueID", // Define the necessary OKE options such as VCN ID, service LB subnet IDs, etc. vcnId: "ocid1.vcn.oc1..exampleuniqueID", kubernetesVersion: "v1.20.11", // example version, specify the available version options: { serviceLbConfig: { // Extra options can be configured here }, }, // Additional configuration options can be set here }); // Define the configuration for deploying the Helm chart const workloadLauncherChart = new k8s.helm.v3.Chart("workloadLauncherChart", { chart: "workload-launcher", // The name of the chart. Ensure that the chart is available in the Helm repository // Define the values for the Helm chart as a dictionary values: { // The key-value pairs here would depend on the Helm chart's available configuration options }, // Specify the namespace where the chart will be installed namespace: "default", }, { // Provide the provider to deploy the Helm chart into the OCI Kubernetes cluster provider: new k8s.Provider("okeK8sProvider", { kubeconfig: okeCluster.kubeconfig, // Use the kubeconfig from the created OKE cluster }), }); // Export the Kubernetes cluster name and the endpoint to access the cluster export const clusterName = okeCluster.name; export const clusterEndpoint = okeCluster.endpoints.apply(e => e.publicEndpoint);

    This Pulumi program will create an Oracle Kubernetes Engine cluster and deploy the workload-launcher Helm chart to it. You define the Helm chart's configuration in the values section. Make sure to fill this in according to the Helm chart you are deploying.

    The oci.ContainerEngine.Cluster resource is used to define and provision the OKE cluster within the compartment specified by compartmentId. The kubernetesVersion and other options under options should be set according to your specific requirements and Oracle's documentation.

    The kubeconfig output of the oci.ContainerEngine.Cluster resource allows us to interact with our Kubernetes cluster by creating a new Pulumi Kubernetes provider.

    To deploy this infrastructure, run the following command:

    pulumi up

    Once you execute the pulumi up command, you will see a preview of the resources that Pulumi plans to create. If everything looks good, confirm the deployment, and Pulumi will provision your OKE cluster and deploy your Helm chart.

    Please refer to the oci.ContainerEngine.Cluster and kubernetes.helm.sh/v3.Chart documentation for more details on the properties and usage of these resources.