1. Deploy the mod-configuration helm chart on Rancher

    TypeScript

    To deploy the mod-configuration Helm chart on Rancher using Pulumi, you will need to use the rancher2.App resource from the rancher2 Pulumi provider. This provider allows you to manage resources in a Rancher environment including deploying applications via Helm charts.

    Here are the key steps that will be performed in the Pulumi program:

    1. Import the necessary Pulumi package for Rancher.
    2. Create an instance of rancher2.App to deploy a Helm chart.
    3. Define the parameters such as the catalog name, chart name, version, name of the application, target namespace, and the project ID where the app will be deployed.

    Below is a detailed Pulumi TypeScript program that deploys the mod-configuration Helm chart on Rancher:

    import * as pulumi from "@pulumi/pulumi"; import * as rancher2 from "@pulumi/rancher2"; // Create a new Rancher2 App instance to deploy the mod-configuration Helm chart. const app = new rancher2.App("mod-configuration-app", { // Specify the project ID where the Helm chart will be deployed. // You can find your Project ID in the Rancher UI or via the Rancher API. projectId: "c-xxxxx:p-yyyyy", // Replace with your actual project ID. // The name of the application. This is how it will appear in Rancher. name: "mod-configuration", // Specify the catalog name that contains the mod-configuration chart. // You must have this catalog installed in your Rancher setup. catalogName: "my-catalog", // Replace with the actual catalog name. // Specify the name of the Helm chart to be deployed. templateName: "mod-configuration", // Specify the version of the Helm chart to be deployed. templateVersion: "1.0.0", // Replace with the chart version you want to deploy. // The namespace in Kubernetes where the app should be deployed. targetNamespace: "default", // Replace with your desired Kubernetes namespace. // Optional: Configuration values for the Helm chart. // This is where you can specify the settings that the chart provides. // For example, you might have values like image tag, service type, etc. answers: { "service.type": "ClusterIP", "image.tag": "latest" }, // Optional: The raw values YAML file to be used by Helm. If provided, it // will override the 'answers' map. // valuesYaml: `service:\n type: ClusterIP\nimage:\n tag: latest`, }); // Export the name of the app export const appName = app.name;

    In this program:

    • We specify the project ID, the target namespace, the name of the Helm chart (templateName), and the version of the chart that we wish to deploy.
    • Since Helm charts may require specific values to configure the deployment, we provide these using the answers field. These values correspond to the configurable options of the mod-configuration Helm chart. You will need to replace the placeholders with actual values required by your Helm chart. If the Helm chart requires a values file, you can also provide that as a multi-line string to the valuesYaml property.
    • Finally, the name of the Rancher application is exported so it can be accessed outside of the program if needed (e.g., for monitoring or further automation tasks).

    Note that you will need to replace placeholder values like "c-xxxxx:p-yyyyy" with actual IDs from your Rancher environment. You can retrieve such details from the Rancher UI or your Rancher administrator.

    Once you have the program set up, you can run it using the Pulumi CLI to apply the changes in your Rancher-managed Kubernetes cluster:

    pulumi up

    This will prompt you with a preview of the changes that will be made and if confirmed, will proceed to deploy the Helm chart to your Rancher cluster.