1. Deploy the argo-workflow helm chart on Google Kubernetes Engine (GKE)

    TypeScript

    To deploy the Argo Workflows Helm chart on Google Kubernetes Engine (GKE), you'll need to complete a multi-step process that involves setting up a GKE cluster, installing the Helm CLI, and finally deploying the Helm chart itself.

    1. Set Up a GKE Cluster: You begin by setting up a Kubernetes cluster in GKE using Pulumi's Google Native provider. This resource is responsible for creating and managing your GKE cluster.

    2. Install Helm: Helm is a package manager for Kubernetes that allows you to deploy applications conveniently. You need to have the Helm CLI installed on your machine or in your CI/CD pipeline.

    3. Deploy Argo Workflows Helm Chart: With the cluster and Helm set up, you'll utilize the Pulumi Kubernetes package to deploy the Argo Workflows Helm chart, specifying the chart version and any configurations needed for your particular deployment.

    Below is a Pulumi program in TypeScript that demonstrates this process. Make sure you have the Pulumi CLI installed and have authenticated with Google Cloud.

    import * as gcp from "@pulumi/gcp"; import * as k8s from "@pulumi/kubernetes"; // Step 1: Set up the GKE cluster const cluster = new gcp.container.Cluster("argo-workflows-cluster", { initialNodeCount: 1, nodeConfig: { machineType: "n1-standard-1", oauthScopes: [ "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/monitoring" ], }, }); // Export the Cluster name export const clusterName = cluster.name; // Obtain the Kubernetes config from the GKE cluster const kubeconfig = cluster.masterAuth.apply(masterAuth => { const context = `${gcp.config.project}_${gcp.config.zone}_${cluster.name}`; return `apiVersion: v1 clusters: - cluster: certificate-authority-data: ${masterAuth.clusterCaCertificate} server: https://${masterAuth.endpoint} name: ${context} contexts: - context: cluster: ${context} user: ${context} name: ${context} current-context: ${context} kind: Config preferences: {} users: - name: ${context} user: auth-provider: config: cmd-args: config config-helper --format=json cmd-path: gcloud expiry-key: '{.credential.token_expiry}' token-key: '{.credential.access_token}' name: gcp `; }); // Export the kubeconfig export const kubeconfigOutput = kubeconfig; // Step 2: Deploy Argo Workflows Helm Chart const argoWorkflows = new k8s.helm.v3.Chart("argo-workflows", { chart: "argo", version: "0.16.7", // Specify the version of Argo Workflows chart you want to deploy fetchOpts: { repo: "https://argoproj.github.io/argo-helm", }, }, { provider: new k8s.Provider("k8s-provider", { kubeconfig }) }); // Export the status of the Helm deployment export const argoWorkflowsStatus = argoWorkflows.status;

    This program will set up a new GKE cluster and deploy the Argo Workflows Helm chart onto it. Here is a quick rundown of what each part does:

    • We create a Cluster resource using the GKE provider (@pulumi/gcp). The cluster will start with a single node, but you can adjust the initialNodeCount and nodeConfig as necessary.

    • We create a new Kubernetes provider instance (@pulumi/kubernetes) using the output kubeconfig from the GKE cluster. This provider is then used to communicate with your new cluster.

    • We deploy the Argo Workflows Helm chart using the helm.v3.Chart resource. Make sure to specify the correct version of the chart you wish to deploy and fetch the chart from the appropriate Helm repository.

    After running this Pulumi program (pulumi up), you'll have a running GKE cluster and the Argo Workflows Helm chart will be deployed on it. This setup allows you to start using Argo Workflows for your CI/CD needs or as a general workflow engine.

    Ensure you check the latest chart version and updated repo URLs as needed, since these can vary and may have changed after this program was written.