1. Deploy the kubeless helm chart on Rancher

    TypeScript

    To deploy the Kubeless helm chart on a Rancher-managed Kubernetes cluster, you'll first need to ensure you have a Rancher Kubernetes cluster available. Then you can use the Pulumi rancher2 package to interact with your Rancher instance to configure a Catalog (to make the helm chart available) and then deploy an App from that Catalog.

    Below is a detailed explanation and a Pulumi program written in TypeScript that demonstrates how to perform these operations. The necessary steps are as follows:

    1. Setup Rancher client configuration: You need to have access to a Rancher cluster and the proper credentials configured in your Pulumi program to manage resources on it.

    2. Create a Catalog V2 resource: This is where you can specify the helm chart repository. Kubeless charts are available in the bitnami repository, which we will add as a Catalog within Rancher.

    3. Deploy the App: Apps in Rancher V2 are equivalent to helm releases. You can specify the chart you wish to deploy (in this case, Kubeless) and the values you want to override, if any.

    The following program demonstrates these steps:

    import * as rancher2 from "@pulumi/rancher2"; // Step 1: Setup Rancher client configuration // The below configuration assumes you have environment variables or Pulumi configuration set // for Rancher access, such as `RANCHER_ACCESS_KEY`, `RANCHER_SECRET_KEY`, and `RANCHER_URL`. // Step 2: Create a Catalog V2 resource for the Kubeless helm chart const kubelessCatalog = new rancher2.CatalogV2("kubeless-catalog", { clusterId: "<YOUR-RANCHER-CLUSTER-ID>", // Replace with your Rancher Cluster ID gitRepo: "https://charts.bitnami.com/bitnami", // Kubeless charts are hosted by Bitnami gitBranch: "master", // Use the master branch of the repository name: "kubeless", // A name for the catalog entry }); // Documentation for CatalogV2: https://www.pulumi.com/registry/packages/rancher2/api-docs/catalogv2/ // Step 3: Deploy the App from the Catalog const kubelessApp = new rancher2.AppV2("kubeless-app", { clusterId: kubelessCatalog.clusterId, // Reference the cluster ID from the catalog resource. chart: "kubeless", // Name of the chart in the catalog namespace: "kubeless", // Specify the namespace for the Kubeless deployment repoName: kubelessCatalog.name, // Reference the name of the catalog entry version: "<CHART-VERSION>", // Specify the version of Kubeless chart you wish to deploy, e.g., "1.0.7" values: ` # Custom values for Kubeless # You can specify any custom values.yaml content here that the Kubeless chart supports `, }); // Documentation for AppV2: https://www.pulumi.com/registry/packages/rancher2/api-docs/appv2/ // Exporting the app name for easy access to check its status export const kubelessAppName = kubelessApp.name; // After running `pulumi up`, this program will create a Catalog entry in your Rancher and then deploy Kubeless // via the new Helm-based App system. You can modify chart version and values according to your needs.

    Make sure to replace <YOUR-RANCHER-CLUSTER-ID> with the ID of the Rancher cluster you want to use and <CHART-VERSION> with the version of the Kubeless chart you wish to deploy.

    After deploying this program with Pulumi, you should have Kubeless running on your Rancher Kubernetes cluster. You can then visit the Rancher dashboard to manage the Kubeless App or use kubectl to interact with it as you would with any Kubernetes-managed application.