1. Deploy the kubeflow-kfserving-inference helm chart on Oracle Kubernetes Engine (OKE)

    TypeScript

    To deploy the Kubeflow KFServing Inference Helm chart on Oracle Kubernetes Engine (OKE), you will need to set up the OKE cluster, configure the Helm chart, and then deploy it using Pulumi's Kubernetes and OCI (Oracle Cloud Infrastructure) providers.

    Prerequisites

    Before you start, make sure you have completed the following steps:

    1. Oracle Cloud Account: You should have an Oracle Cloud account with the necessary permissions to create and manage Kubernetes clusters and deploy Helm charts.

    2. Pulumi Account & CLI: You need a Pulumi account and the Pulumi CLI installed. Make sure you have logged in using pulumi login, and your OCI credentials are configured either through the OCI CLI or environment variables.

    3. OCI Provider Configuration: Pulumi utilizes the OCI provider to manage resources in Oracle Cloud. Ensure that you have the provider set up and authenticated.

    4. Kubernetes Provider Configuration: Pulumi's Kubernetes provider interacts with your Kubernetes cluster to deploy applications and services. The provider needs to be correctly set up with access to your OKE cluster.

    5. Helm: Helm is a package manager for Kubernetes, which Pulumi can leverage to deploy applications defined in Helm charts. Ensure the Kubeflow KFServing Inference Helm chart is available from a reachable Helm repository.

    Deployment Steps

    The following Pulumi program completes these main tasks:

    • Creates an OKE cluster using the OCI Container Engine for Kubernetes (oci.ContainerEngine.Cluster).
    • Deploys the Kubeflow KFServing Inference Helm chart using the Kubernetes provider's Chart resource.

    Pulumi Program

    Below is a TypeScript program that deploys a basic OKE cluster and then deploys the KFServing Helm chart to it.

    import * as pulumi from "@pulumi/pulumi"; import * as oci from "@pulumi/oci"; import * as k8s from "@pulumi/kubernetes"; // Step 1: Create an Oracle Kubernetes Engine (OKE) Cluster const cluster = new oci.containerengine.Cluster("myOkeCluster", { // Specify your compartment ID here compartmentId: pulumi.interpolate`${oci.config.compartmentId}`, // Define cluster options here, such as VCN ID and Kubernetes version // This is a basic example, for a production setup you would customize the below properties options: { // Add Kubernetes options, such as addons, service LB subnet IDs, and more serviceLbConfig: { // Configuration details for the load balancer } }, // Define other cluster parameters like name and type as per your requirements name: "example-cluster", type: "Quick Create", // Change it to "Custom Create" to specify more detailed settings // ... other required properties ... }); // Step 2: Create a KubeConfig const kubeconfig = pulumi. all([cluster.id, cluster.metadata]) .apply(([id, metadata]) => oci.containerengine.getClusterKubeconfig({ clusterId: id, options: metadata, })); // Step 3: Setup the Kubernetes provider with the kubeconfig const provider = new k8s.Provider("myK8sProvider", { kubeconfig: kubeconfig.kubeconfig, }); // Step 4: Deploy the kubeflow-kfserving-inference Helm chart on OKE const kfservingChart = new k8s.helm.v3.Chart("kfserving", { chart: "kfserving", version: "0.5.1", // Specify the version of KFServing you want to deploy fetchOpts: { // Specify the Helm repository and other chart details here repo: "https://kubeflow.github.io/kfserving/", }, // If there's a need to override default chart values, specify them here values: { // Custom values for the KFServing chart }, }, { provider: provider }); export const kubeconfigOutput = kubeconfig.kubeconfig; export const clusterEndpoint = cluster.endpoints.publicEndpoint;

    Explanation of the Program

    1. Creating an OKE Cluster: The program begins by creating a new OKE cluster using oci.containerengine.Cluster. This part requires the compartment ID where the cluster will reside and various other options like networking and version specifications for the Kubernetes cluster.

    2. Generating Kubeconfig: Once the cluster is provisioned, it generates a kubeconfig file that is required to interact with the Kubernetes cluster using oci.containerengine.getClusterKubeconfig. Both cluster ID and metadata are used to generate this configuration.

    3. Kubernetes Provider Setup: With the kubeconfig obtained, it instantiates a new Kubernetes provider to interact with the OKE cluster. It is important to ensure that all subsequent Kubernetes resources reference this provider to have the correct context when deploying to the cluster.

    4. Deploying the Helm Chart: Finally, the program uses k8s.helm.v3.Chart to deploy the KFServing Helm chart. You should specify the chart version and the Helm repository it's located at. Additionally, if there are any custom values you need to specify for the Helm chart, you can do so in the values field.

    Outputs:

    At the end of the program, we export both the kubeconfig and the public endpoint of the Kubernetes cluster. These are key details that you will use to interface with your cluster outside of Pulumi.

    Running the Program

    Once you have this program, you should:

    1. Save it in a file with .ts extension, such as deployKfserving.ts.
    2. Run pulumi up from the command line in the same directory as your new .ts file. Pulumi will perform the deployment as defined.

    Remember to review any stack outputs or messages from Pulumi to ensure that your deployment succeeds and rectify any issues if necessary.