Deploy the argo-app-manager helm chart on Rancher
TypeScriptTo deploy the Argo CD ApplicationSet Controller, which is part of the Argo Project, using a Helm chart onto a Kubernetes cluster managed by Rancher, you'll first need to have access to a Kubernetes cluster in Rancher. Pulumi doesn't currently have a specific resource for Helm charts, but we can use the
pulumi/kubernetes
provider to perform Helm chart deployments.The following Pulumi program in TypeScript will guide you through setting up the prerequisites and deploying the Argo CD ApplicationSet Controller via Helm. The
helm.v3.Chart
resource from the@pulumi/kubernetes
package will be used for this purpose.Before you begin, you'll need to ensure that:
- You have Pulumi installed and set up.
- You have access to a Kubernetes cluster managed by Rancher and have
kubectl
configured to interact with it. - You have the required permissions to deploy resources to the cluster.
Here's the step-by-step guide and the corresponding Pulumi TypeScript program:
Detailed Explanation
Import the Required Packages
First, import the necessary packages:
@pulumi/pulumi
for core Pulumi functionalities and@pulumi/kubernetes
to interact with Kubernetes resources including deploying a Helm chart.Configure Kubernetes Provider
Next, set up a Kubernetes provider to connect to your Rancher Kubernetes cluster. The configuration for the provider typically comes from the local kubeconfig file generated by
rancher2
or can be explicitly passed to the Pulumi Kubernetes provider if needed.Deploy the Helm Chart
Now, you can use the
helm.v3.Chart
class to deploy the Argo CD ApplicationSet Controller Helm Chart. You'll need to specify several options like the chart name, version, and repository URL, and you may need to provide custom values via thevalues
property to customize the deployment.Export the Outcome
After the deployment, it may be useful to export certain information, like the Argo CD server URL or other relevant data that can be used to access the deployed application.
Pulumi TypeScript Program
import * as pulumi from '@pulumi/pulumi'; import * as k8s from '@pulumi/kubernetes'; // Initialize a Kubernetes provider configured from the local kubeconfig file const k8sProvider = new k8s.Provider('k8s-provider', { kubeconfig: pulumi.output(pulumi.getStackReference('my-org/my-rancher-cluster-stack')).apply(s => s.outputs.kubeconfig), }); // Define the Helm chart for the Argo CD ApplicationSet Controller const argoAppSetController = new k8s.helm.v3.Chart('argo-appset-controller', { chart: 'argo-cd-applicationset-controller', version: '1.0.0', // Replace with the desired chart version fetchOpts: { repo: 'https://argoproj.github.io/argo-helm', // Repository URL where the chart is located }, // You can customize the chart values here if needed // values: { // ... // } }, { provider: k8sProvider }); // Export the name of the deployed chart export const chartName = argoAppSetController.metadata.apply(metadata => metadata.name);
Make sure to replace
'my-org/my-rancher-cluster-stack'
with the appropriate stack reference that contains your Rancher Kubernetes cluster configuration.With this program, Pulumi understands that it needs to deploy a Helm chart named 'argo-appset-controller' from the Argo project's Helm repository to the configured Kubernetes cluster.
Run the above program by executing
pulumi up
, and Pulumi will perform the deployment to your Rancher-managed Kubernetes cluster.Remember, if you're customizing the values for the Helm chart or have specific configurations, you would add or adjust the key-value pairs in the
values
section of theChart
resource. It's also possible to use a local values file by loading it into the program and passing it to the chart.Keep in mind that while Pulumi automates deployment tasks, understanding Kubernetes, Helm, and ArgoCD concepts is crucial for troubleshooting and maintaining the deployed resources.