Deploy the komodor-agent helm chart on AWS EKS
TypeScriptTo deploy the Komodor-agent Helm chart on an Amazon EKS (Elastic Kubernetes Service) cluster, you will follow these broad steps:
-
Create an EKS cluster: Set up the EKS cluster where your Kubernetes workloads will run.
-
Deploy the Helm chart: Once you have a Kubernetes cluster, you can proceed with deploying the Komodor-agent Helm chart to the cluster.
Before starting, make sure that you have Pulumi installed and configured for use with AWS.
Here is a detailed Pulumi program written in TypeScript that performs these tasks:
import * as eks from "@pulumi/eks"; import * as aws from "@pulumi/aws"; import * as pulumi from "@pulumi/pulumi"; import * as k8s from "@pulumi/kubernetes"; // Create an EKS cluster with the default configuration. const cluster = new eks.Cluster("my-cluster", { desiredCapacity: 2, // Specify the desired number of cluster nodes minSize: 1, // Specify the minimum number of nodes for auto-scaling maxSize: 3, // Specify the maximum number of nodes for auto-scaling instanceType: "t2.medium", // Select an AWS instance type for the nodes }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig; // Create a provider for the EKS cluster. This will be used to instantiate all Kubernetes resources. const provider = new k8s.Provider("provider", { kubeconfig: cluster.kubeconfig, }); // Deploy the Komodor-agent Helm chart to the EKS cluster using the provider. const helmChart = new k8s.helm.v3.Chart( "komodor-agent", { // Use the actual Helm chart repository and chart name for komodor-agent. repo: "komodorio", chart: "komodor-agent", // You can specify the version, and any custom values required for your deployment. version: "1.2.3", // Use the appropriate version number values: { // Fill in the required values for your Komodor agent deployment, for example: apiKey: "your-komodor-api-key", // Use your actual Komodor API key clusterName: "my-cluster", // Optional: Set a name for your cluster in Komodor // ... Additional custom values can be set here as needed. }, }, { provider } // Use the provider created for the EKS cluster. ); // Export the status of the Helm release. export const helmStatus = helmChart.status;
The program above completes the following actions:
- It sets up an EKS cluster named
"my-cluster"
with the specified node configuration. - It exports the generated
kubeconfig
, which you can use to connect to your cluster viakubectl
or other Kubernetes tooling. - It creates a Kubernetes provider tied to the newly created EKS cluster's kubeconfig.
- It deploys the Komodor-agent using a Helm chart within the context of the Kubernetes provider.
Please replace
"your-komodor-api-key"
with your actual Komodor API key and adjust theversion
to the release you wish to deploy. You may also need to add or adjustvalues
to match the specific configuration required for the Komodor-agent Helm chart.After this program runs successfully, the Komodor-agent will be deployed to your EKS cluster, and you should be able to see your cluster's information and logs within the Komodor dashboard using the provided API key.
To run the program, save it to a
index.ts
file and use the Pulumi CLI to create and update your stack:pulumi up
This command will provision the resources as per the program's definitions. Keep an eye on the output to see details of the resources being created and any outputs exported by the program, such as
kubeconfig
for accessing the EKS cluster andhelmStatus
to check the status of the Helm chart deployment.-