Deploy the empathyco-backstage helm chart on AWS EKS
TypeScriptTo deploy the
empathyco-backstage
Helm chart on AWS EKS, we'll follow these steps:- Create an EKS cluster using the
eks.Cluster
component, which simplifies creating an Amazon EKS cluster. - Create an IAM role using
aws-iam.EKSRole
that EKS can assume to create AWS resources for Kubernetes. - Deploy the Helm chart onto the EKS cluster using the
kubernetes.helm.sh/v3.Chart
resource.
Here is a Pulumi TypeScript program to accomplish these steps:
import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; import * as awsx from "@pulumi/awsx"; import * as eks from "@pulumi/eks"; import * as k8s from "@pulumi/kubernetes"; // Step 1: Creating an EKS cluster // This component resource abstracts away the complex configurations of an EKS cluster. const vpc = new awsx.ec2.Vpc("my-vpc", { numberOfAvailabilityZones: 2 }); const cluster = new eks.Cluster("my-eks-cluster", { vpcId: vpc.id, subnetIds: vpc.publicSubnetIds, instanceType: "t2.medium", desiredCapacity: 2, minSize: 1, maxSize: 2, storageClasses: "gp2", deployDashboard: false, }); // Step 2: Creating an IAM role for the EKS cluster // The AWS IAM role that will be used by the EKS cluster to create and manage AWS resources. const eksRole = new aws.iam.Role("eksRole", { assumeRolePolicy: aws.eks.getClusterAssumeRolePolicy(), }); // Attach the AWS managed policies necessary for the EKS cluster to the created role. new aws.iam.RolePolicyAttachment("eksPolicyAttachment-AmazonEKSWorkerNodePolicy", { policyArn: aws.iam.ManagedPolicy.AmazonEKSWorkerNodePolicy, role: eksRole.name, }); new aws.iam.RolePolicyAttachment("eksPolicyAttachment-AmazonEKS_CNI_Policy", { policyArn: aws.iam.ManagedPolicy.AmazonEKS_CNI_Policy, role: eksRole.name, }); new aws.iam.RolePolicyAttachment("eksPolicyAttachment-AmazonEC2ContainerRegistryReadOnly", { policyArn: aws.iam.ManagedPolicy.AmazonEC2ContainerRegistryReadOnly, role: eksRole.name, }); // Step 3: Deploying the 'empathyco-backstage' Helm chart // The `kubernetes.helm.sh/v3.Chart` resource is used to deploy third-party applications packaged as Helm charts. const helmChart = new k8s.helm.v3.Chart("empathyco-backstage", { chart: "backstage", version: "0.1.0", // Replace with the actual chart version if necessary fetchOpts: { repo: "http://charts.empathy.co/", // URL to the repository where the chart is hosted }, values: { // Provide any specific configurations for 'empathyco-backstage' chart. }, }, { provider: cluster.provider }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig;
This program creates an EKS cluster within a new VPC and deploys the
empathyco-backstage
Helm chart onto it.awsx.ec2.Vpc
creates a new VPC for our EKS cluster with two availability zones for high availability.eks.Cluster
creates an EKS cluster with a specified node size, capacity, and associated storage class.aws.iam.Role
andaws.iam.RolePolicyAttachment
set up the necessary IAM role for the EKS cluster to interact with AWS services.k8s.helm.v3.Chart
deploys theempathyco-backstage
Helm chart from the specified repository onto the EKS cluster.
You need to have Pulumi installed, AWS CLI configured with appropriate credentials, and kubectl installed to interact with the Kubernetes cluster.
Please replace the placeholder values such as
version
,repo
, or any values withinvalues
with the actual values for your configuration.To run this program, save it to a
index.ts
file, open your terminal in the same directory, and execute:pulumi up
This will initiate the deployment process. Follow the prompts to preview and then confirm the deployment.
Remember to check the availability of the specified Helm chart version and its repository, and fill in the appropriate values for the Helm chart as required.
- Create an EKS cluster using the