Deploy the argocd-certificate-refresh helm chart on Rancher
TypeScriptTo deploy the
argocd-certificate-refresh
Helm chart on Rancher using Pulumi, you need to prepare your environment and have access to a Rancher instance.The program will involve several steps:
-
Setup Rancher Resource: You need to create a
CatalogV2
resource, pointing to the Helm repository that contains theargocd-certificate-refresh
chart. You also need aNamespace
where the Helm chart will be installed. -
Install Helm Chart: With the catalog in place, you use the
rancher2.AppV2
resource to install theargocd-certificate-refresh
Helm chart into the desired namespace.
Here's a Pulumi TypeScript program that puts these steps into action. Keep in mind that you'll need to have Pulumi installed, configured, and connected to your Rancher instance for this to work:
import * as rancher2 from "@pulumi/rancher2"; // Pulumi program to deploy a Helm chart on Rancher. // Create a Rancher Namespace to deploy the chart. const namespace = new rancher2.Namespace("argocd-cert-ns", { projectId: "<project-id>", // Replace with your Rancher Project ID. name: "argocd-cert-ns", // Additional properties like labels and annotations can be added if required. }); // Add a Catalog for the Helm repository that includes argocd-certificate-refresh const catalog = new rancher2.CatalogV2("argocd-catalog", { clusterId: "<cluster-id>", // Replace with your Rancher Cluster ID. gitRepo: "https://<helm-chart-repo>", // Replace with the Helm chart repository URL name: "argocd-catalog", gitBranch: "main", // Specify the branch if it's not the default 'main'. // Additional properties like labels and annotations can be added if required. }); // Install the argocd-certificate-refresh Helm chart from the added catalog const app = new rancher2.AppV2("argocd-cert-app", { clusterId: "<cluster-id>", // Replace with your Rancher Cluster ID. namespace: namespace.name, repoName: catalog.name, chartName: "argocd-certificate-refresh", // The name of the chart in the catalog/repository. chartVersion: "<chart-version>", // Replace with specific chart version, if required. // If Helm values are needed for installation, provide them as 'values' in the YAML format. // values: ` // key: value // nested: // key: value // `, }); // After running `pulumi up`, the Helm chart will be installed into the Rancher cluster.
In this program:
-
We first create a
Namespace
which is a common Kubernetes concept representing an isolated group of services within the cluster. Replace"<project-id>"
with the actual Project ID from your Rancher instance. -
We set up a
CatalogV2
resource which points to the Git repository containing the Helm chart we want to deploy. Replace"<helm-chart-repo>"
with the URL of the Git repository that houses theargocd-certificate-refresh
Helm chart. -
Finally, we use the
AppV2
resource to deploy the Helm chart. You'll need to replace"<cluster-id>"
with your actual Rancher Cluster ID and specify<chart-version>
if you want to install a specific version of the Helm chart. If you have specific Helm values you wish to override, you can provide these as a YAML formatted string to thevalues
property.
To use this Pulumi program, you will need to have the Pulumi CLI installed and configured with the Rancher provider. You can write this code into a file named
index.ts
, for example, and run it using the Pulumi CLIup
command to create the resources in your Rancher cluster. Ensure you're logged into the correct context that has access to your Rancher cluster.Please replace placeholder strings like
"<project-id>"
,"<cluster-id>"
, and"<helm-chart-repo>"
with actual values relevant to your setup before running the program.-