Deploy the livekit-recorder helm chart on AWS EKS
TypeScriptTo deploy the
livekit-recorder
Helm chart on an AWS EKS cluster, we’ll need to follow these steps:-
Create the EKS Cluster: We will create an Amazon EKS cluster, which is a managed Kubernetes service that makes it easy for you to run Kubernetes on AWS without needing to install and operate your own Kubernetes control plane.
-
Deploy the Helm Chart: Once the cluster is ready, we can deploy the
livekit-recorder
Helm chart on our EKS cluster. Helm charts help you define, install, and upgrade even the most complex Kubernetes applications.
Below is a Pulumi program written in TypeScript. This program will set up an EKS cluster and then deploy the
livekit-recorder
Helm chart to that cluster.Detailed Explanation:
First, we'll initialize a new Pulumi project and create an EKS cluster using the
eks.Cluster
class. This cluster will have default settings, which are suitable for many use cases. The cluster will be provisioned with a default node group to run our workloads.Next, we'll deploy the
livekit-recorder
Helm chart using thekubernetes.helm.v3.Chart
class, which represents a Helm chart in a Pulumi program.This example assumes you have AWS credentials configured on your machine and that those credentials have sufficient permissions to create these resources. If you're running it in an environment without AWS credentials, you will need to set up the AWS provider with appropriate credentials.
Here's the TypeScript program:
import * as pulumi from "@pulumi/pulumi"; import * as awsx from "@pulumi/awsx"; 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("my-cluster", {}); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig; // Set up a provider using the above kubeconfig to deploy Helm charts to the cluster. const provider = new k8s.Provider("k8s-provider", { kubeconfig: cluster.kubeconfig.apply(JSON.stringify), }); // Deploy the livekit-recorder Helm chart. const livekitRecorderChart = new k8s.helm.v3.Chart("livekit-recorder", { chart: "livekit-recorder", // Add the Helm repository URL here if it's not a stable chart or set the repo and version accordingly. // Example: // version: "x.y.z", // repo: "https://helm-repository-url.com/", }, { provider }); // Export the resources created. export const livekitRecorderChartResources = livekitRecorderChart.resources;
Usage:
Run this program with
pulumi up
after saving it asindex.ts
in a Pulumi project directory.Details on the Program:
-
The
eks.Cluster
constructor initializes a new EKS cluster. You can specify custom configurations such as VPC, subnets, node types, and more in the object passed to it. -
kubeconfig
is an output that holds the configuration required to connect to your cluster withkubectl
and other Kubernetes tools. -
The
k8s.Provider
is instantiated with the generatedkubeconfig
to interact with the EKS cluster. -
livekit-recorder
is deployed as a helm chart using thek8s.helm.v3.Chart
class. Remember to replace thechart
,version
, andrepo
with the correct values for thelivekit-recorder
chart. -
livekitRecorderChartResources
holds the details for all Kubernetes resources created as a result of deploying thelivekit-recorder
Helm chart so you can reference them in your program if needed.
Before you run the command
pulumi up
, make sure you have installed Pulumi CLI and initialized a Pulumi project. If thelivekit-recorder
Helm chart requires any custom values or you want to override the defaults, you can specify them in thevalues
argument to theChart
resource. For more complex configurations, please consult the EKS documentation and the Helm Chart documentation on the Pulumi website.-