Deploy the atlas-deployment helm chart on AWS EKS
TypeScriptTo deploy the
atlas-deployment
Helm chart on an AWS EKS cluster using Pulumi, you will first need to create an EKS cluster and then deploy the Helm chart to it.Below are the main steps in the process:
- Create the EKS Cluster: Utilizing
@pulumi/eks
package, which provides a high-level interface to EKS, simplifying cluster creation. - Deploy the Helm Chart: Using
@pulumi/kubernetes
to deploy Helm charts to the created EKS cluster.
Detailed Process and Pulumi Program
First, you should install the necessary Pulumi packages by running these commands:
npm install @pulumi/pulumi npm install @pulumi/aws npm install @pulumi/awsx npm install @pulumi/eks npm install @pulumi/kubernetes
Now, you'll write a Pulumi program in TypeScript to create an EKS cluster and deploy the Helm chart. Here is a program that outlines the steps necessary to accomplish this:
import * as eks from "@pulumi/eks"; import * as awsx from "@pulumi/awsx"; import * as k8s from "@pulumi/kubernetes"; // Create an EKS cluster with the default configuration. const cluster = new eks.Cluster("my-cluster"); // Create a Kubernetes provider instance that uses our EKS cluster from above. const k8sProvider = new k8s.Provider("k8s-provider", { kubeconfig: cluster.kubeconfig.apply(JSON.stringify), }); // Deploy the atlas-deployment Helm chart into our EKS cluster. const atlasDeploymentChart = new k8s.helm.v3.Chart("atlas-deployment", { chart: "atlas-deployment", version: "x.y.z", // Replace with the actual chart version you wish to deploy fetchOpts: { repo: "http://chart-repository-url/" // Replace with the actual Helm chart repository URL }, }, { provider: k8sProvider }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig;
Explanation of Resources
-
eks.Cluster
: This creates a new EKS cluster. In the above example, it's using the default settings for quick setup. You can customize it further to specify the VPC, IAM roles, and other settings. -
k8s.Provider
: The Kubernetes provider is necessary for Pulumi to interact with the created EKS cluster. It uses the kubeconfig from theeks.Cluster
to communicate with the cluster. -
k8s.helm.v3.Chart
: This resource is employed to deploy a Helm chart on a Kubernetes cluster. The example deploys theatlas-deployment
chart, wherechart
specifies the Helm chart's name andversion
is the chart's version.
Make sure you replace
"x.y.z"
with the actual version of theatlas-deployment
Helm chart and"http://chart-repository-url/"
with the chart's repository URL.After writing this program, you'd run
pulumi up
to execute it, which would create the EKS cluster and deploy your Helm chart.Remember to review and modify the inputs as per your requirements, including the Helm chart version and any specific chart values you want to override with the
values
attribute inside thek8s.helm.v3.Chart
resource.- Create the EKS Cluster: Utilizing