Deploy the argo-workflow helm chart on AWS EKS
TypeScriptTo deploy the Argo Workflows Helm Chart on an AWS EKS cluster using Pulumi, you need to follow these steps:
- Set up an EKS cluster.
- Install the Helm Chart for Argo Workflows on the cluster.
Below you'll find a Pulumi TypeScript program that accomplishes these tasks.
Pulumi Program Explanation
First, you will initialize an EKS cluster. Pulumi's EKS package (
@pulumi/eks
) simplifies creating an EKS cluster by abstracting the underlying resources needed for the setup. The cluster will automatically be configured with the default settings, but you can customize it according to your preferences.Next, you will use the
@pulumi/kubernetes
package to deploy resources to Kubernetes. You will deploy the Argo Workflows Helm chart using theChart
resource from the Pulumi Kubernetes provider.Here's the TypeScript Pulumi program which carries out the necessary steps:
import * as eks from "@pulumi/eks"; import * as k8s from "@pulumi/kubernetes"; // Create an EKS cluster with the default configuration. const cluster = new eks.Cluster("argo-workflows-cluster", {}); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig; // Create a Kubernetes provider instance that uses our EKS cluster. const provider = new k8s.Provider("eks-k8s", { kubeconfig: cluster.kubeconfig, }); // Deploy Argo Workflows Helm chart to the EKS cluster. const argoWorkflowsChart = new k8s.helm.v3.Chart("argo-workflows", { chart: "argo-workflows", version: "4.5.2", // Specify the version of the Helm chart. namespace: "argo", // Deploy Argo Workflows in its own namespace. fetchOpts: { repo: "https://argoproj.github.io/argo-helm", // Helm repository hosting Argo Workflows. }, }, { provider }); // Export the Argo Workflows Helm chart deployment status. export const argoWorkflowsStatus = argoWorkflowsChart.status;
Explanation
- We use the
eks.Cluster
resource to create an EKS cluster, naming it "argo-workflows-cluster". - The
kubeconfig
export provides the necessary configuration for kubectl and other tools to interact with the cluster. - We then instantiate a
Provider
to configure the Kubernetes provider with thekubeconfig
from the EKS cluster we created. - The
k8s.helm.v3.Chart
resource deploys Argo Workflows to the EKS cluster. It refers to the chart located in the official Argo project's Helm repository. - By setting the
namespace
to"argo"
, we specify that Argo Workflows should be installed in a dedicated namespace. - Finally, we export the status of the Helm chart deployment so you can easily check whether the deployment succeeded.
Assuming you have Pulumi CLI installed and AWS credentials configured, you can run this program by saving it to a file called
index.ts
, installing the required dependencies withnpm
oryarn
, and runningpulumi up
.Remember to replace the versions of the Pulumi packages and Helm chart with the ones appropriate at the time you run this.