1. Deploy the ckan helm chart on Rancher

    TypeScript

    To deploy the CKAN Helm chart on Rancher, you need to perform the following steps:

    1. Set up a Rancher cluster where you will deploy the CKAN Helm chart. This involves provisioning the Kubernetes cluster and importing it into Rancher if it’s not already managed by Rancher.
    2. Add a Helm catalog to Rancher that includes the CKAN chart.
    3. Deploy the CKAN Helm chart from the catalog to your cluster.

    In this Pulumi program, I am going to assume that you have already set up your Rancher cluster and it is accessible and managed through Rancher. The program will show you how to add a Helm catalog to Rancher and deploy the CKAN chart to your cluster using Pulumi with the Rancher2 provider.

    We will use the rancher2.CatalogV2 resource to add a new catalog source. Once the catalog is available, the specific chart you want to deploy (i.e., CKAN) should be available for deployment to your cluster.

    Below is a TypeScript Pulumi program that adds a new Helm catalog in Rancher and deploys the CKAN chart to a specified namespace:

    import * as rancher2 from "@pulumi/rancher2"; // You must provide your Rancher cluster ID, where you want to deploy CKAN. const clusterId = "your-rancher-cluster-id"; // Provision a new catalog in Rancher that includes the CKAN Helm chart. const ckanCatalog = new rancher2.CatalogV2("ckan-catalog", { clusterId: clusterId, url: "URL-to-CKAN-helm-chart-repository", // Replace with the URL to the CKAN Helm chart repository. gitRepo: "https://github.com/ckan/ckan-helm", // This is an example URL. Please replace it with the correct Git repository URL if different. gitBranch: "main", }); // Assuming ckanCatalog unpacks to a chart named 'ckan' const ckanChart = new rancher2.AppV2("ckan", { clusterId: clusterId, chartName: "ckan", namespace: "ckan-namespace", // Replace with the actual namespace where you want CKAN to be deployed. repoName: ckanCatalog.name, // Set chart values for CKAN configuration. // These will depend on your specific CKAN deployment and the configuration options provided by the CKAN chart maintainers. values: { // Replace with your specific configuration options }, }); // Export values that might be interesting. For instance, the catalog name. export const catalogName = ckanCatalog.metadata.apply(m => m.name);

    Please make sure you have the right permissions and the cluster ID available to successfully run this Pulumi program. You will also need to replace placeholders like URL-to-CKAN-helm-chart-repository with the actual URL where the CKAN Helm chart is hosted. Adjust chart values as per your requirements; the values field in the rancher2.AppV2 resource is where you can specify custom configuration options for the CKAN Helm chart.

    Before running the above Pulumi program, ensure the following:

    • Install Pulumi CLI and set up the Pulumi project.
    • Configure Pulumi to authenticate with your Kubernetes cluster and Rancher.
    • Replace all placeholder values with actual values relevant to your environment.

    After you run the program, it will add the specified catalog to your Rancher setup and then deploy the CKAN Helm chart to the Kubernetes cluster managed by Rancher. The exported value catalogName will give you the name of the catalog created once the program is executed.

    Please refer to Rancher2 provider for more details and adjust your resource properties to match your exact setup.