1. Deploy the mozilla-common-voice helm chart on AWS EKS

    TypeScript

    To deploy the Mozilla Common Voice Helm chart on AWS EKS, we'll need to create an EKS cluster and then deploy the chart to it. Below, I will outline the steps you'll take and then show you a Pulumi TypeScript program that performs these steps.

    1. Create an EKS Cluster: We'll define a Pulumi EKS cluster resource that represents the EKS cluster.
    2. Deploy Helm Chart on EKS: Using Pulumi's Helm Chart resource, we'll deploy Mozilla Common Voice chart to the EKS cluster created in the previous step.

    We'll use the @pulumi/eks library for creating the EKS cluster because it provides a high-level abstraction over the necessary resources and is easier to work with than the raw @pulumi/aws resources. We'll also use the @pulumi/kubernetes library to deploy the Helm chart.

    Here's a step-by-step Pulumi TypeScript program to achieve this:

    import * as eks from "@pulumi/eks"; import * as k8s from "@pulumi/kubernetes"; // Step 1: Create an AWS EKS Cluster. // The `eks.Cluster` resource will provision an EKS cluster. You can specify the desired node count, node size, and other settings. const cluster = new eks.Cluster("my-cluster", { desiredCapacity: 2, minSize: 1, maxSize: 2, instanceType: "t2.medium", // Choose an appropriate instance type. }); // Step 2: Deploy the Mozilla Common Voice Helm chart to the EKS cluster. // We will use the `k8s.helm.v3.Chart` resource to deploy the Mozilla Common Voice Helm chart. const commonVoiceChart = new k8s.helm.v3.Chart("mozilla-common-voice", { // Specify the repository and chart information here. // This should be the name of the chart and its repository. // Since I don't have an actual chart URL for Mozilla Common Voice, you'll need to replace this with the correct one. chart: "common-voice", repo: "mozilla-common-voice-repo", version: "1.0.0", // Replace with the version you want to deploy. namespace: "default", }, { provider: cluster.provider }); // Export the cluster's kubeconfig and the service URL once the deployment is ready. export const kubeconfig = cluster.kubeconfig; export const serviceUrl = commonVoiceChart.getResourceProperty("v1/Service", "common-voice-service", "status").apply(s => `http://${s.loadBalancer.ingress[0].hostname}`);

    Explanation of what this program does:

    • eks.Cluster: This creates a managed Kubernetes cluster on AWS EKS. We specify the desired capacity and size of our nodes within the cluster. Adjust these according to your expected load and performance requirements.
    • k8s.helm.v3.Chart: This represents a Helm chart deployment in Kubernetes. Since Helm charts package up applications for Kubernetes, we use this to deploy Mozilla Common Voice to our EKS cluster.

    Make sure to replace "mozilla-common-voice-repo" and other placeholder strings like chart version with the actual values from the Mozilla's Helm chart repository you want to use.

    This Pulumi program is a starting point, and you may need to configure other settings based on the Mozilla Common Voice Helm chart's requirements or your AWS settings. Ensure to have the Pulumi CLI installed and AWS credentials configured for Pulumi to access your AWS account.

    Once you have this file saved (for example index.ts), you can deploy your infrastructure running:

    pulumi up

    Upon successful deployment, Pulumi will output the Kubernetes cluster's kubeconfig file and the service URL for the deployed Common Voice application. You can then use this kubeconfig file to interact with your EKS cluster using kubectl.