Deploy the woonley helm chart on AWS EKS
TypeScriptTo deploy the Woonley Helm chart on AWS EKS, you'll need to complete several steps including setting up an EKS cluster, configuring Kubernetes to interact with it, and finally deploying the Helm chart to the cluster. Below is a Pulumi program that will create an EKS cluster and deploy the Woonley Helm chart to it using TypeScript.
First, make sure you have Pulumi installed and configured for AWS.
The following program uses three main Pulumi resources:
-
eks.Cluster: This resource will create an EKS cluster. You can configure it further by setting properties such as the
name
,vpcId
,subnetIds
, etc. -
kubernetes.helm.v3.Chart: This is a Pulumi Kubernetes resource that allows you to deploy Helm charts.
-
pulumi.Config: While not a physical resource, this Pulumi class allows you to access configuration parameters which can be set in the Pulumi CLI or in a
Pulumi.yaml
file.
Before running the following code, you should configure your AWS credentials as environment variables (
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
) or through the AWS CLI.import * as pulumi from '@pulumi/pulumi'; 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('myEksCluster', {}); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig; // Deploy the Woonley Helm chart to the EKS cluster. const woonleyHelmChart = new k8s.helm.v3.Chart('woonleyHelmChart', { chart: 'woonley', // Replace '<YOUR HELM CHART REPO>' with the name of the Helm repo where the Woonley chart is located, // or specify the Helm chart URL if it's hosted elsewhere. repo: '<YOUR HELM CHART REPO>', namespace: 'default', // Deploy to the default namespace or specify another namespace. // Set any values for the Helm chart as needed. values: { key: 'value' // Replace with the actual values for the Woonley chart. }, }, { provider: cluster.provider }); // Export the Helm chart deployment's status export const woonleyHelmChartStatus = woonleyHelmChart.status;
The program begins by importing the necessary Pulumi libraries. It then creates an EKS cluster.
The
eks.Cluster
is where your Kubernetes cluster is defined. By default, Pulumi creates a small, two-node cluster, but you can customize this to your needs with additional parameters.The
kubeconfig
is exported so you can use it withkubectl
on your local machine to interact with your Kubernetes cluster.With the EKS cluster up and running, the
k8s.helm.v3.Chart
resource deploys the Woonley Helm chart. You need to replace'<YOUR HELM CHART REPO>'
with the name of the Helm repository where the Woonley chart can be found. If it's not in a Helm repo, you can specify the exact URL where the Helm chart is located for Pulumi to fetch it.The
values
object in the Helm chart definition is a place where you can put all the configurations that your Woonley chart accepts, such as image versions or resource requests or limits.Once you've set this code up in a
index.ts
file, you can run it using the Pulumi CLI:pulumi up
This command will prompt you to confirm the actions before applying them, showing a detailed preview of the resources Pulumi will create, update, or destroy.
By running it, you will create an AWS EKS cluster and deploy the Woonley Helm chart onto it.
-