1. Deploy the pipecd helm chart on AWS EKS

    TypeScript

    To deploy the PipeCD Helm chart on AWS EKS using Pulumi, we'll go through the following steps:

    1. Set up an EKS Cluster: We require an Amazon Elastic Kubernetes Service (EKS) cluster to run our Kubernetes workloads.
    2. Create an ECR Repository: To store container images we'll need an Elastic Container Registry (ECR).
    3. Deploy Helm Chart: Finally, we'll deploy the PipeCD Helm chart to the EKS cluster.

    We're using the following Pulumi resources:

    • aws.eks.Cluster: To create an EKS Cluster in AWS.
    • aws.ecr.Repository: To create an ECR repository.
    • kubernetes.helm.v3.Chart: To deploy a Helm chart on Kubernetes.

    Below is the TypeScript program to accomplish our goal.

    import * as pulumi from '@pulumi/pulumi'; import * as aws from '@pulumi/aws'; import * as eks from '@pulumi/eks'; import * as k8s from '@pulumi/kubernetes'; // Create an EKS cluster. const cluster = new eks.Cluster("my-cluster", { instanceType: "t2.medium", desiredCapacity: 2, minSize: 1, maxSize: 3, storageClasses: "gp2", deployDashboard: false, }); // Export the clusters' kubeconfig. export const kubeconfig = cluster.kubeconfig; // Create an ECR repository to store PipeCD images. const repo = new aws.ecr.Repository("my-repo", { imageScanningConfiguration: { scanOnPush: true, }, }); // Export the repository URL to push container images to. export const repositoryUrl = repo.repositoryUrl; // Create a provider for the above-created EKS cluster. const provider = new k8s.Provider("provider", { kubeconfig: kubeconfig, }); // Deploy PipeCD Helm chart using the above-created EKS cluster kubeconfig. const pipecd = new k8s.helm.v3.Chart("pipecd", { chart: "pipecd", version: "0.10.5", // specify the exact chart version to maintain stability fetchOpts: { repo: "https://charts.pipecd.dev", // PipeCD Helm chart repository } }, { provider: provider }); // Export the Helm chart status export const pipecdStatus = pulumi.output(pipecd.status);

    As we've exported kubeconfig and repositoryUrl, after running pulumi up, you will get these values printed out at the console. The kubeconfig will allow you to interact with your EKS cluster using kubectl, and repositoryUrl is the URL of the ECR repository where you can push your container images.

    Make sure you have Pulumi CLI configured with AWS credentials and have the necessary IAM permissions to create these resources on AWS.

    Also note that Helm charts may have additional values you can configure. This example deploys the PipeCD Helm chart with default values, however, you might want to customize the deployment by specifying different Helm values corresponding to the chart's configurable options.

    Before deploying, always verify that the specific version of Helm chart that you are going to deploy is compatible with your EKS cluster's Kubernetes version and make sure you review the values that the chart exposes for configuration.