1. Deploy the ibm-eventstreams-operator helm chart on Oracle Kubernetes Engine (OKE)

    TypeScript

    To deploy the ibm-eventstreams-operator Helm chart on Oracle Kubernetes Engine (OKE) using Pulumi, we will follow a few steps:

    1. Create the Kubernetes cluster on OKE: We'll use the oci.ContainerEngine.Cluster resource to provision our Kubernetes cluster.

    2. Install the Helm Chart: Once the cluster is up and running, we'll use the kubernetes.helm.sh/v3.Chart resource to deploy the ibm-eventstreams-operator Helm chart to the cluster.

    Below is the TypeScript program. First, let's import the required Pulumi packages:

    import * as pulumi from '@pulumi/pulumi'; import * as k8s from '@pulumi/kubernetes'; import * as oci from '@pulumi/oci';

    Next, we'll provision an OKE cluster. The specifics of the cluster, such as the compartment ID, VCN, and subnet IDs, will need to be set according to your Oracle Cloud Infrastructure (OCI). These values are represented as placeholders in the code until you replace them with actual values from your environment.

    // Create an Oracle Kubernetes Engine (OKE) cluster const cluster = new oci.ContainerEngine.Cluster("okeCluster", { // Specify the compartment ID where the cluster should be created compartmentId: "<YOUR_COMPARTMENT_ID>", // Specify the VCN ID vcnId: "<YOUR_VCN_ID>", kubernetesVersion: "v1.21.5", options: { // Configure add-ons like Tiller if necessary addOns: { isTillerEnabled: false, // Use Helm 3 which doesn't require Tiller isKubernetesDashboardEnabled: false, }, // Reference the service load balancer options serviceLbSubnetIds: ["<YOUR_LB_SUBNET_ID1>", "<YOUR_LB_SUBNET_ID2>"], }, // Other required properties like name, type, etc. name: "myOkeCluster", type: "QUICKCREATE", }); // Export the cluster ID export const clusterId = cluster.id;

    To install the Helm chart, we need to set up a Kubernetes provider that will allow Pulumi to interact with our OKE cluster. This provider will use the kubeconfig that we get from the OKE cluster.

    // Set up the Kubernetes provider using the kubeconfig from the new OKE cluster const k8sProvider = new k8s.Provider("k8sProvider", { kubeconfig: cluster.kubeConfigs[0].content.apply(content => Buffer.from(content, 'base64').toString('utf-8')), }); // Deploy the ibm-eventstreams-operator Helm chart using Helm v3 const ibmEventstreamsChart = new k8s.helm.v3.Chart("ibm-eventstreams-operator", { chart: "ibm-eventstreams-operator", // Specify the Helm repository URL if necessary fetchOpts: { repo: "https://<HELM_REPO_URL>" }, namespace: "default", // Namespace to install the Helm chart. Adjust if required. // Values to be passed to the Helm chart, adjust them according to the chart's requirements values: {}, }, { provider: k8sProvider }); // Export the Helm chart name export const helmChartName = ibmEventstreamsChart.name;

    Here's the entire program put together. Replace the placeholder values with the correct values from your OCI environment before running this Pulumi program.

    import * as pulumi from '@pulumi/pulumi'; import * as k8s from '@pulumi/kubernetes'; import * as oci from '@pulumi/oci'; // Create an OKE cluster const cluster = new oci.ContainerEngine.Cluster("okeCluster", { compartmentId: "<YOUR_COMPARTMENT_ID>", vcnId: "<YOUR_VCN_ID>", kubernetesVersion: "v1.21.5", options: { addOns: { isTillerEnabled: false, isKubernetesDashboardEnabled: false, }, serviceLbSubnetIds: ["<YOUR_LB_SUBNET_ID1>", "<YOUR_LB_SUBNET_ID2>"], }, name: "myOkeCluster", type: "QUICKCREATE", }); export const clusterId = cluster.id; // Set up the Kubernetes provider const k8sProvider = new k8s.Provider("k8sProvider", { kubeconfig: cluster.kubeConfigs[0].content.apply(content => Buffer.from(content, 'base64').toString('utf-8')), }); // Deploy the ibm-eventstreams-operator Helm chart const ibmEventstreamsChart = new k8s.helm.v3.Chart("ibm-eventstreams-operator", { chart: "ibm-eventstreams-operator", fetchOpts: { repo: "https://<HELM_REPO_URL>" }, namespace: "default", values: {}, }, { provider: k8sProvider }); export const helmChartName = ibmEventstreamsChart.name;

    Before you run pulumi up to apply this program, you need to replace <YOUR_COMPARTMENT_ID>, <YOUR_VCN_ID>, <YOUR_LB_SUBNET_ID1>, <YOUR_LB_SUBNET_ID2>, and https://<HELM_REPO_URL> with the actual configuration values for your OCI environment and the Helm repository you are using.

    This program will set up a new OKE cluster using the OCI provider and deploy the ibm-eventstreams-operator Helm chart into the default Kubernetes namespace using the Kubernetes provider.

    Remember to authenticate with OCI CLI and set up the required Pulumi stacks and configuration before running this program. You can check the Pulumi documentation for OCI and Kubernetes for additional details on the setup process.