1. Deploy the seldon-core-analytics helm chart on Oracle Kubernetes Engine (OKE)

    TypeScript

    To deploy the seldon-core-analytics Helm chart on Oracle Kubernetes Engine (OKE), you will be creating a Pulumi program using TypeScript. The basic steps we will cover include setting up the Pulumi program, creating an instance of OKE, and deploying the Helm chart to that instance.

    Setting up the Pulumi Program

    A Pulumi program is structured just like any other Node.js application; it requires a package.json file to define the project and its dependencies.

    Before you begin, ensure that you have installed Pulumi and configured it to use your Oracle Cloud Infrastructure (OCI) account. You will also need Node.js and npm installed to create a Pulumi project.

    Creating the Pulumi Project

    1. From your terminal, create a new directory for your Pulumi project and cd into it:
    mkdir seldon-core-analytics-oke && cd seldon-core-analytics-oke
    1. Initialize a new Pulumi project with the following command. When prompted, choose typescript for the language:
    pulumi new typescript
    1. Install the necessary Pulumi packages for working with OCI and Kubernetes. In your project directory, run:
    npm install @pulumi/oci @pulumi/kubernetes

    Creating the OKE Instance

    In your Pulumi program, you will first create the Oracle Kubernetes Engine instance where you will deploy the Helm chart.

    Deploying the Helm Chart

    After you have the Kubernetes cluster, you will deploy the seldon-core-analytics Helm chart to the cluster using the @pulumi/kubernetes package.

    Below is a basic template for creating the OKE cluster and deploying the Helm chart. This template assumes that you already have a defined compartment and VCN (Virtual Cloud Network) in OCI where you want to deploy the Kubernetes cluster.

    Let's get started with the Pulumi program:

    import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Initialize OCI provider configuration const provider = new oci.Provider("oci", { // You must configure your Oracle Cloud Infrastructure region and other settings in the Pulumi configuration. // This can be done via the Pulumi CLI or using environment variables. }); // You would replace these placeholders with your specific compartment and VCN information on Oracle Cloud Infrastructure. const compartmentId = "your-compartment-oci-id"; const vcnId = "your-vcn-oci-id"; // Create an OKE cluster const cluster = new oci.ContainerEngine.Cluster("okeCluster", { compartmentId, vcnId, // ... additional required properties like node pool configuration }, { provider }); // Use the generated kubeconfig from the OKE cluster to configure the Kubernetes provider const k8sProvider = new k8s.Provider("k8sProvider", { kubeconfig: cluster.kubeconfig.getContent(), }); // Deploy the seldon-core-analytics Helm chart const seldonCoreAnalyticsChart = new k8s.helm.v3.Chart("seldon-core-analytics", { chart: "seldon-core-analytics", // The `version` field should specify the version of the chart you want to deploy. // The `repo` field should point to the Helm repository that hosts the seldon-core-analytics chart. // You may need to fetch and specify the exact chart name and repository URL depending on where the Helm chart is hosted. values: { // ... your specific configuration for seldon-core-analytics }, }, { provider: k8sProvider }); // Export the cluster's kubeconfig and the Helm release's status export const kubeconfig = cluster.kubeconfig.getContent(); export const seldonCoreAnalyticsStatus = seldonCoreAnalyticsChart.status;

    In this program:

    • We import the OCI and Kubernetes modules from Pulumi's npm packages.
    • We declare our OCI provider instance and Oracle Cloud Infrastructure location details.
    • We create an OKE instance using the oci.ContainerEngine.Cluster class while providing the necessary parameters such as compartment ID and VCN ID. oci.ContainerEngine.Cluster documentation.
    • We configure the Kubernetes provider with the kubeconfig obtained from the OKE instance.
    • We deploy the seldon-core-analytics Helm chart using the Chart class from the @pulumi/kubernetes package. kubernetes.helm.v3.Chart documentation.
    • We export the kubeconfig and the status of the Helm chart deployment which would be useful to access your cluster and check the deployment status.

    Running the Pulumi Program

    To run this Pulumi program:

    1. Save the code in a file named index.ts in your project directory.
    2. Use the pulumi up command in your terminal to execute the Pulumi program and create the resources.

    During execution, Pulumi will show you a preview of the resources that will be created and prompt you for confirmation before proceeding. If everything looks correct, confirm the deployment, and Pulumi will begin creating the OKE cluster and then deploy the Helm chart to it.

    After the deployment is completed, you can use the exported kubeconfig to configure your local kubectl and interact with your OKE cluster. You can also check the deployment status of the seldon-core-analytics Helm chart using the exported status.

    Remember to replace placeholder strings with actual values that are relevant to your Oracle Cloud Infrastructure environment, such as compartment and VCN identifiers. Additionally, you may need to add specific configuration options for the Helm chart to suit your use case.