1. Deploy the kserve-inference helm chart on AWS EKS


    To deploy the kserve-inference Helm chart on AWS EKS using Pulumi, we need to accomplish a few steps. First, we will create an EKS cluster, and then we will deploy the Helm chart to this cluster.

    Here's a high-level overview of what we're going to do:

    1. Create an EKS Cluster: We will first define and create an Amazon EKS cluster where our application will run.
    2. Deploy the Helm Chart: After the cluster is set up, we will deploy the kserve-inference Helm chart, which will provision the necessary KServe server infrastructure on the EKS cluster.

    To do this, we will use the eks and kubernetes packages from Pulumi, which provide ways to work with EKS clusters and Helm charts, respectively. We'll use the eks.Cluster resource to create the cluster, and kubernetes.helm.v3.Chart to deploy the Helm chart.

    Below is a TypeScript program that defines and creates these resources using Pulumi.

    Remember, you must have AWS access configured for Pulumi, which is typically done via AWS access keys or by using an AWS configuration file. Make sure Pulumi is installed, configured for AWS, and you have Helm charts accessible to Pulumi.

    Now, let's create the Pulumi program:

    import * as eks from "@pulumi/eks"; import * as k8s from "@pulumi/kubernetes"; // Create an EKS cluster. const cluster = new eks.Cluster("kserve-cluster", { desiredCapacity: 2, // Define the desired number of cluster nodes. minSize: 1, maxSize: 3, storageClasses: "gp2", // Define the storage class for the EKS cluster. // You may include additional configuration such as VPC ID, subnet IDs, instance types, etc. }); // Create a Kubernetes provider instance that uses our EKS cluster. const k8sProvider = new k8s.Provider("k8s-provider", { kubeconfig: cluster.kubeconfig.apply(JSON.stringify), }); // Deploy the kserve-inference Helm chart to the EKS cluster. const kserveChart = new k8s.helm.v3.Chart("kserve-inference", { chart: "kserve-inference", // The chart name. This may change and should be the exact name of the Helm chart for KServe. // If your Helm chart is not in the default repo, you'd also need `repo` property. values: { // Place your customized values here. // For example, you might want to specify the image, tag, and other configurations specific to your needs. }, }, { provider: k8sProvider }); // Export the kubeconfig to access the cluster. export const kubeconfig = cluster.kubeconfig; // Export the cluster name, which can be helpful for tracking or for use in other scripts. export const clusterName = cluster.core.cluster.name; // When you run `pulumi up`, Pulumi will provision an EKS cluster and deploy the kserve-inference Helm chart to it.

    This program initializes a new EKS cluster with the name kserve-cluster and a Helm chart deployment named kserve-inference. The desiredCapacity, minSize, and maxSize parameters define the scaling properties of the node group within the EKS cluster.

    Please, ensure to replace "kserve-inference" in the chart field with the correct name of the Helm chart that you wish to deploy, and provide any custom values that the Helm chart accepts to customize its deployment to your preferences.

    Remember this is a rudimentary example, and a production-grade deployment might include finer details like custom VPCs, IAM roles, and specific node properties.

    For more information and configuration options, please check out the following resources: