1. Deploy the kubeflow-kfserving-inference helm chart on Digital Ocean Kubernetes Service

    TypeScript

    To deploy the kubeflow-kfserving-inference Helm chart on the DigitalOcean Kubernetes Service using Pulumi, you will need to follow these steps:

    1. Set up a DigitalOcean Kubernetes Cluster: You'll first need to create a Kubernetes cluster in DigitalOcean. To do this, you will use the digitalocean.KubernetesCluster resource from the DigitalOcean Pulumi provider.

    2. Install the Helm Chart: After your Kubernetes cluster is up and running, you can install the Helm chart. For this, you'll need to utilize the kubernetes.helm.v3.Chart resource which allows you to deploy a Helm chart onto your Kubernetes cluster.

    Below is a Pulumi program written in TypeScript that demonstrates these steps. This program assumes you have already set up Pulumi with the necessary DigitalOcean token and state backend configuration.

    import * as pulumi from "@pulumi/pulumi"; import * as digitalocean from "@pulumi/digitalocean"; import * as k8s from "@pulumi/kubernetes"; // Step 1: Create a DigitalOcean Kubernetes Cluster const cluster = new digitalocean.KubernetesCluster("kubeflow-cluster", { region: "nyc3", version: "latest", // This would select the latest version supported by DigitalOcean nodePool: { name: "kubeflow-pool", size: "s-2vcpu-2gb", nodeCount: 1, }, }); // Step 2: Deploy the kubeflow-kfserving-inference Helm chart const kfservingChart = new k8s.helm.v3.Chart("kfserving-inference", { chart: "kubeflow-kfserving-inference", // Assuming there's a Helm repository that hosts the kubeflow-kfserving-inference chart fetchOpts: { repo: "https://kubeflow-charts.storage.googleapis.com/", }, // Specify the values for the helm chart here values: { // ... your custom values ... }, }, { provider: new k8s.Provider("k8s-provider", { kubeconfig: cluster.kubeConfigs[0].rawConfig }) }); // Export the kubeconfig export const kubeconfig = cluster.kubeConfigs[0].rawConfig; // Export the endpoint of the kubeflow-kfserving-inference service export const kfservingEndpoint = kfservingChart.getResourceProperty("v1/Service", "kfserving-inference", "status");

    Make sure to replace the placeholder value for the repo property with the actual Helm repository URL where the kubeflow-kfserving-inference chart is hosted. Additionally, under values, customize the Helm chart values as needed for your Kubeflow KFServing inference services.

    In this program:

    • digitalocean.KubernetesCluster: This creates a new Kubernetes cluster on DigitalOcean. We define the number of nodes, machine size, and the cluster's region. To learn more, visit the DigitalOcean KubernetesCluster documentation.

    • k8s.helm.v3.Chart: This Pulumi resource is used to deploy Helm charts into a Kubernetes cluster. You specify the chart name, any relevant configuration values, and point to the Kubernetes provider associated with your newly created cluster. For more details, here's the Helm Chart documentation.

    • k8s.Provider: The Kubernetes provider resource connects the Helm chart resource to the right Kubernetes cluster through the cluster's kubeconfig.

    • exports: These are used to output the kubeconfig for your cluster as well as any other keys that you want to be displayed after Pulumi finishes running. Exports can be used effectively to retrieve necessary information such as endpoints or credentials.

    To use this Pulumi program:

    1. Save the code into a file with a .ts extension (for example, deploy-kfserving.ts).
    2. Run pulumi up to preview and deploy the changes. You must have Pulumi installed and configured with access to your DigitalOcean account.
    3. Once applied, Pulumi will provision a DigitalOcean Kubernetes cluster and deploy the kubeflow-kfserving-inference Helm chart to it. The kubeconfig can be used to interact with the cluster using kubectl, and the outputted kfservingEndpoint can be used to access the deployed services.