1. Deploy the kubeflow-kfserving helm chart on AWS EKS

    TypeScript

    To deploy the Kubeflow KFServing Helm chart on AWS EKS, we will need to accomplish a few high-level steps:

    1. Set up an AWS EKS cluster using the eks.Cluster resource from Pulumi's EKS package.
    2. Deploy the Kubeflow KFServing Helm chart within the EKS cluster using Pulumi's Kubernetes provider and the kubernetes.helm.v3.Chart resource.

    The below TypeScript program performs the following actions:

    • Configure an EKS cluster, specifying the desired settings for node groups, such as instance type and min/max size.
    • Define a Helm chart resource for Kubeflow KFServing, specifying the necessary Helm values according to the chart's requirements.

    Make sure you have AWS credentials configured and the Kubernetes/Helm Pulumi providers installed.

    Here's the TypeScript program that sets up the EKS cluster and deploys KFServing:

    import * as eks from "@pulumi/eks"; import * as k8s from "@pulumi/kubernetes"; import * as pulumi from "@pulumi/pulumi"; const projectName = "kubeflow-kfserving"; // Create an EKS cluster with the desired configuration const cluster = new eks.Cluster(projectName, { instanceType: "t2.medium", // Use a medium sized instance desiredCapacity: 2, // Desired number of instances in the node group minSize: 1, // Minimum number of instances in the node group maxSize: 3, // Maximum number of instances in the node group // other cluster configurations such as VPC, IAM roles, etc. }); // Export the cluster's kubeconfig so that we can access it export const kubeconfig = cluster.kubeconfig; // Initialize a Kubernetes Provider using the EKS cluster's kubeconfig const k8sProvider = new k8s.Provider(projectName, { kubeconfig: cluster.kubeconfig.apply(JSON.stringify), }); // Define the Kubeflow KFServing Helm chart const kfservingChart = new k8s.helm.v3.Chart("kfserving", { chart: "kfserving", version: "0.6.0", // Specify the version of KFServing you wish to deploy fetchOpts: { repo: "https://kubeflow.github.io/kfserving/", // The Helm chart repository for Kubeflow KFServing }, // Include any custom values required for the Helm chart values: { // Custom values for KFServing or other dependencies }, }, { provider: k8sProvider }); // Export the Helm chart name export const kfservingChartName = kfservingChart.metadata.apply(m => m.name); // When the program is deployed, you should get kubeconfig as output and // will be able to use it to connect to your new EKS cluster and verify the deployment.

    This program is a starting point and you may need to fine-tune the configuration. For example, the instance type, and the minimum and the maximum size of instances might need adjustment based on the workload. You should also provide any required custom Helm values in the 'values' field to satisfy KFServing's configuration needs. Check the KFServing Helm chart for further customization options.

    To apply this Pulumi program:

    1. Save the code in a file with a .ts extension (e.g., index.ts).
    2. Run pulumi up in the same directory as the file.
    3. Pulumi CLI will perform the deployment, and you will be provided with outputs such as the kubeconfig.