Deploy the newrelic-private-minion helm chart on AWS EKS
TypeScriptDeploying a Helm chart to an Amazon Elastic Kubernetes Service (EKS) cluster involves several steps. First, you'll need to create an EKS cluster if you don't have one already. Then, you'll need to deploy the Helm chart to that cluster. In this case, you want to deploy the
newrelic-private-minion
Helm chart.Below is a Pulumi program written in TypeScript that accomplishes this. It consists of:
- Creating an EKS cluster using the
awsx.eks.Cluster
resource. This abstracts away much of the complexity in setting up an EKS cluster. - Deploying the
newrelic-private-minion
Helm chart to the EKS cluster using thekubernetes.helm.v3.Chart
resource.
Make sure you have Pulumi installed, AWS CLI configured with appropriate permissions to create resources, and Helm CLI installed for chart deployment if necessary.
Here's the detailed Pulumi program for the entire setup:
import * as awsx from "@pulumi/awsx"; import * as kubernetes from "@pulumi/kubernetes"; import * as pulumi from "@pulumi/pulumi"; // Create a VPC for the EKS cluster. const vpc = new awsx.ec2.Vpc("pulumi-vpc", { numberOfAvailabilityZones: 2, }); // Create an EKS cluster with the default configuration. const cluster = new awsx.eks.Cluster("pulumi-eks-cluster", { vpcId: vpc.id, subnetIds: vpc.privateSubnetIds, }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig; // Deploy the newrelic-private-minion Helm chart. const newrelicChart = new kubernetes.helm.v3.Chart("newrelic-private-minion", { chart: "newrelic-private-minion", // You need to specify the repository if it's not in the Helm stable repository fetchOpts: { repo: "https://helm-charts.newrelic.com", // Replace with the correct repository URL }, // Optionally, you can provide values to customize the deployment as needed. values: { // Placeholder values, replace with actual configuration. licenseKey: "<Your-NewRelic-License-Key>", clusterName: "<Your-Cluster-Name>", // ...additional chart values. }, }, { provider: cluster.getProvider() }); // Export the Helm chart name and status. export const newrelicChartName = newrelicChart.getResourceName(); export const newrelicChartStatus = newrelicChart.status;
Explanation:
- The
awsx.ec2.Vpc
resource is used here to create a new VPC configured with private subnets and distributed across two availability zones for high availability. - An EKS cluster named
pulumi-eks-cluster
is provisioned with theawsx.eks.Cluster
resource within the VPC created above. By default, the EKS cluster will be created with an IAM role and security groups. - The
kubeconfig
output exported makes it possible for you to interact with your cluster usingkubectl
by simply setting this output as yourKUBECONFIG
environment variable or merging it into your~/.kube/config
file. - The Helm chart for
newrelic-private-minion
is deployed using thekubernetes.helm.v3.Chart
resource. Before running this Pulumi program, you must have the correct Helm repository added to your Helm configuration, as it's assumed that the chart is not in the default Helm repo. ThefetchOpts
is where you specify the repository URL. - The
values
property within the Helm chart is used to specify any configuration options required by thenewrelic-private-minion
chart. You'll need to replace<Your-NewRelic-License-Key>
and<Your-Cluster-Name>
with actual values.
This is a high-level overview and you may need to specify additional configuration parameters based on your requirements. Refer to the
awsx
andkubernetes.helm.v3.Chart
documentation for more details on configuration options.- Creating an EKS cluster using the