Deploy the flyte-sandbox helm chart on AWS EKS
TypeScriptTo deploy the flyte-sandbox Helm chart on AWS EKS, you'll need to perform a series of steps using Pulumi. You will first create an EKS cluster, and then you will deploy the Helm chart to that cluster.
Here's a high-level overview of the steps involved:
- Set up a new EKS cluster: For this, you’ll be utilizing the
awsx.ecs.Cluster
component which simplifies the creation of an EKS cluster. - Deploy the flyte-sandbox: With the cluster set up, you will deploy the Helm chart using the
kubernetes.helm.v3.Chart
resource.
Let's dive into the Pulumi TypeScript program that accomplishes this:
import * as pulumi from '@pulumi/pulumi'; import * as awsx from '@pulumi/awsx'; import * as k8s from '@pulumi/kubernetes'; // Step 1: Create an EKS cluster where the flyte-sandbox will be deployed const vpc = new awsx.ec2.Vpc("flyte-vpc", { numberOfAvailabilityZones: 2, }); const cluster = new awsx.eks.Cluster("flyte-cluster", { vpcId: vpc.id, subnetIds: vpc.publicSubnetIds, instanceType: "t3.medium", desiredCapacity: 2, minSize: 1, maxSize: 3, }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig; // Step 2: Deploy the flyte-sandbox Helm chart onto the EKS cluster const flyteChart = new k8s.helm.v3.Chart("flyte-sandbox", { chart: "flyte", version: "v0.6.28", // Specify the version of the chart matching your requirements. fetchOpts: { repo: "https://flyteorg.github.io/flyte", // URL of the helm repository for flyte }, values: { sandbox: { enabled: true, }, }, }, { provider: cluster.provider }); // Export the URL to access the Flyte sandbox. // This assumes that the sandbox chart provides an endpoint or some means of external connectivity. export const flyteSandboxUrl = pulumi.interpolate`http://<EXTERNAL-IP>`;
This Pulumi program is doing the following:
- It first sets up a new VPC and an EKS cluster within that VPC. It configures the cluster with a small instance type suitable for sandbox purposes and allows you to scale between 1 and 3 nodes.
- The kubeconfig needed to interact with your cluster using
kubectl
is exported. - Then, it deploys the flyte-sandbox Helm chart from the official Flyte Helm repository. Ensure that the version number of the chart matches the one that you want to deploy.
- Lastly, we export a URL placeholder where you would be able to access your Flyte sandbox. Note that you will need to replace
<EXTERNAL-IP>
with the actual external IP or domain of your Flyte service once it is deployed. This information would be retrieved from the Helm chart's outputs, which depends on the specifics of the deployed chart.
Please make sure you have Pulumi installed and configured for use with AWS. You will need appropriate IAM roles and permissions set up to create EKS clusters.
After you've written this code to a file (e.g.,
index.ts
), run the following commands to deploy your infrastructure:pulumi up
This command will prompt you to confirm the deployment after showing you the planned changes.
Remember to replace
<EXTERNAL-IP>
with the actual address of your service, which you can find after your chart is successfully deployed by examining the corresponding Kubernetes service or ingress resources.Keep in mind the cost and permissions associated with running resources on AWS. Ensure you have the necessary permissions to create and manage EKS clusters and associated resources within your AWS account.
- Set up a new EKS cluster: For this, you’ll be utilizing the