1. Deploy the ibm-cp4d-watson-studio-instance helm chart on Oracle Kubernetes Engine (OKE)

    TypeScript

    To deploy the IBM Cloud Pak for Data (CP4D) Watson Studio instance using a Helm chart on Oracle Kubernetes Engine (OKE), you'll need to perform several steps. This will involve setting up OCI (Oracle Cloud Infrastructure) resources, configuring Kubernetes, and using Helm to deploy the chart.

    Here's how you can achieve this with Pulumi in TypeScript:

    1. Set up an OCI Container Repository for storing Docker images that will be used by OKE.
    2. Provision an OKE Kubernetes cluster where your applications will be running.
    3. Configure Helm to deploy the IBM CP4D Watson Studio helm chart onto the OKE cluster.

    Below is a detailed Pulumi program written in TypeScript that achieves the mentioned steps. The program uses the OCI provider to create the necessary cloud infrastructure and the Kubernetes provider to configure and deploy the application using Helm.

    import * as oci from "@pulumi/oci"; import * as kubernetes from "@pulumi/kubernetes"; import * as pulumi from "@pulumi/pulumi"; // Note: Ensure that your OCI and Kubernetes configuration is set up in your environment. // i.e., $ pulumi config set oci:compartmentId <value> and that the kubeconfig for OKE is correctly configured. const compartmentId = "<Your OCI Compartment ID>"; // Replace with your OCI compartment ID // Step 1: Create an OCI Container Repository (if required) const repo = new oci.Artifacts.ContainerRepository("watsonStudioRepo", { compartmentId: compartmentId, displayName: "watson-studio-repo", isPublic: true, // or false, depending on your requirements // Additional configuration can be provided as needed. }); // Step 2: Provision an OKE Kubernetes Cluster const cluster = new oci.ContainerEngine.Cluster("okeCluster", { compartmentId: compartmentId, name: "watson-studio-cluster", kubernetesVersion: "v1.20.8", // Specify the version of Kubernetes you want to use vcnId: "<Your VCN ID>", // Replace with your VCN ID options: { serviceLbSubnetIds: ["<Your Subnet IDs>"], // Replace with your Subnet IDs // Additional configuration can be provided as needed. }, // Define other necessary properties for your use case. }); // Step 3: Use the Kubernetes provider to configure the Helm chart deployment of IBM CP4D Watson Studio. // Note: The kubeconfig for the OKE cluster needs to be set up in your environment. // Import the Kubernetes cluster from OCI to Pulumi to handle the cluster's kubeconfig const k8sProvider = new kubernetes.Provider("okeK8sProvider", { kubeconfig: cluster.kubeConfigRaw, }); // Deploy the Helm chart for IBM CP4D Watson Studio const watsonStudioHelmChart = new kubernetes.helm.v3.Chart("watsonStudioHelmChart", { chart: "ibm-cp4d-watson-studio-instance", // Ensure this is the correct name of the Helm chart you want to deploy // Specify the Helm repository or the exact chart location, values, version, etc. // For example: repo: "https://charts.helm.sh/stable" // values: {} // Add any custom value overrides for the Helm chart version: "1.0.0", // Specify the chart version namespace: "default", // Replace with the namespace where you want to deploy your chart }, { provider: k8sProvider }); // Exporting useful information for the user export const okeClusterName = cluster.name; export const okeClusterId = cluster.id; export const repositoryUrl = repo.repositoryUrl; export const helmChartName = watsonStudioHelmChart.getResourceProperty("v1/Service", "watson-studio-service", "metadata.name");

    Explanation of the resources used:

    • oci.Artifacts.ContainerRepository: Represents a repository in Oracle Cloud Infrastructure Registry where Docker images can be stored.
    • oci.ContainerEngine.Cluster: Defines a managed Kubernetes cluster within OCI's Container Engine for Kubernetes service.
    • kubernetes.helm.v3.Chart: Represents a Helm chart, which is a package of pre-configured Kubernetes resources. Using this resource allows you to deploy applications packaged in Helm charts on your Kubernetes cluster.

    The kubeconfig attribute from the cluster is used to configure the k8sProvider. This provider is then used for the deployment of the Helm chart.

    Remember to replace placeholder values (like <Your OCI Compartment ID>, <Your VCN ID>, <Your Subnet IDs>, etc.) with actual values from your OCI setup.

    This program will provision a new Kubernetes cluster within your specified compartment on OKE and deploy the IBM CP4D Watson Studio instance using the specified Helm chart. Always ensure the Helm chart name and version match the chart you wish to deploy. Before running this Pulumi program, install the necessary NPM packages by running npm install.

    To deploy this infrastructure, run pulumi up. Pulumi will execute the program and provision the resources as described.

    Please be aware that managing cloud resources can result in charges from your cloud provider, so keep an eye on the associated costs. Additionally, ensure that you have the necessary permissions within your OCI compartment to create and manage these resources.