Deploy the tt-workflow-driver helm chart on Rancher
TypeScriptTo deploy a Helm chart on a Rancher-managed Kubernetes cluster using Pulumi, you will carry out the following steps:
- Set up the Rancher2 provider within your Pulumi program to interact with your Rancher instance.
- Use the
rancher2.Cluster
resource to define which Kubernetes cluster managed by Rancher you want to deploy your Helm chart to. - Utilize the
rancher2.AppV2
resource, which represents a Helm chart deployment on a Rancher cluster.
Before you begin, you will need:
- Access to a Rancher instance and the credentials to authenticate.
- The name of the Kubernetes cluster managed by Rancher where you will deploy the Helm chart.
- Information about the Helm chart you want to deploy (
tt-workflow-driver
in this case), like the repository URL and the chart version.
Below is a Pulumi TypeScript program that demonstrates these steps. In this example, I'm assuming you've already authenticated with Rancher and have access to a Kubernetes cluster.
import * as rancher2 from "@pulumi/rancher2"; // Define the Rancher Cluster where you want to deploy your Helm chart. // You will need to provide the cluster ID, which you can get from the Rancher UI or API. const cluster = new rancher2.Cluster("my-cluster", { // `clusterId` here is a placeholder. Replace it with your actual cluster ID. clusterId: "c-12345", // ... (other necessary parameters according to your Rancher setup) }); // Deploy the `tt-workflow-driver` Helm chart onto the specified Rancher-managed Kubernetes cluster. const helmChart = new rancher2.AppV2("tt-workflow-driver", { // Use the `clusterId` from the `cluster` we are targeting. clusterId: cluster.id, namespace: "default", // Specify the namespace where the chart should be installed. repoName: "helm-repo-name", // Replace this with the name of the Helm repository. chartName: "tt-workflow-driver", // The chart name. chartVersion: "1.0.0", // The version of the chart you want to deploy. // You can specify values for your Helm chart in the `values` property. values: ` image: example/tt-workflow-driver:latest replicas: 2 ` }); // Export the app name of the chart that we deployed. export const helmAppName = helmChart.name;
This program creates a reference to a Rancher-managed cluster (you must replace the placeholder values with your actual cluster ID and other parameters) and deploys the
tt-workflow-driver
chart from the specified Helm repository onto that cluster in thedefault
namespace.Please note that you will have to replace
helm-repo-name
with the actual name of the Helm chart repository that contains thett-workflow-driver
and1.0.0
with the version of the chart you want to install.The
values
property is used to provide the values that customize the Helm chart. You would replace the contents of thevalues
string to reflect the actual values required by yourtt-workflow-driver
helm chart.After defining your resources, you can run your Pulumi program using the pulumi CLI commands. Here are the general steps to execute the program:
- Initialize a new Pulumi stack with
pulumi stack init
. - Install your Pulumi program dependencies with
npm install
. - Preview the deployment with
pulumi preview
. - Deploy your resources with
pulumi up
.
At the end of the process, if you want to access the name of the deployed Helm chart, you can use the exported variable
helmAppName
which will show you the name of the app in your Pulumi stack outputs.