Deploy the irods-csi-driver helm chart on AWS EKS
TypeScriptTo deploy the irods-csi-driver helm chart on AWS EKS using Pulumi, we will perform the following steps:
-
Create an EKS Cluster: We will start by creating an EKS cluster to run our Kubernetes applications. This requires setting up a cluster and its associated compute infrastructure within AWS.
-
Deploy Helm Chart on EKS: Once the cluster is ready, we will utilize the
kubernetes.helm.v3.Chart
resource to deploy the irods-csi-driver helm chart on our EKS cluster.
Here is a detailed Pulumi TypeScript program that sets up an EKS cluster and deploys the irods-csi-driver helm chart onto it:
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: Create an EKS cluster const vpc = new awsx.ec2.Vpc("vpc", {}); const cluster = new eks.Cluster("eks-cluster", { vpcId: vpc.id, // Use the VPC we created above subnetIds: vpc.publicSubnetIds, // Use the VPC's public subnets instanceType: "t2.medium", // Specify the desired EC2 instance type for the worker nodes desiredCapacity: 2, // Initial desired number of worker nodes minSize: 1, // Minimum number of worker nodes maxSize: 3, // Maximum number of worker nodes storageClasses: "gp2", // Default storage class for EBS volumes }); const kubeconfig = pulumi.secret(cluster.kubeconfig); // Step 2: Create a provider for the cluster created above to host Helm charts const provider = new k8s.Provider("eks-provider", { kubeconfig: cluster.kubeconfig.apply(JSON.stringify) // Serialize the `kubeconfig` to string format as expected by the Provider }); // Step 3: Deploy the irods-csi-driver helm chart using the Helm Chart resource const irodsCsiDriverChart = new k8s.helm.v3.Chart("irods-csi-driver", { chart: "irods-csi-driver", // The name of the chart version: "1.1.1", // Specify the chart version (ensure this is the version you desire) namespace: "kube-system", // Specify the namespace to install the chart into fetchOpts: { repo: "https://cyverse.github.io/irods-csi-driver/", // Helm repository where the chart is hosted }, }, { provider }); // Ensure we use the provider that we declared earlier // Export the Kubeconfig and EKS cluster name export const clusterName = cluster.eksCluster.name; export const kubeconfigExport = kubeconfig; // Run this program using the Pulumi CLI: // pulumi up // After deployment, you can interact with your EKS cluster using `kubectl`: // kubectl --kubeconfig <path-to-kubeconfig> get all --namespace kube-system
This program defines a VPC using the
awsx.ec2.Vpc
resource, which creates a new VPC suitable for an EKS cluster, ensuring that the EKS cluster will have a network to operate within. Then it creates the EKS cluster witheks.Cluster
with a default node group that matches the desired specifications like instance type and scaling options.Once the EKS cluster is ready, we declare a
k8s.Provider
which uses the kubeconfig from the created EKS cluster to interact with it. This provider configuration will be used when we install the helm chart.Finally, with the
k8s.helm.v3.Chart
resource, we install the irods-csi-driver Helm chart into thekube-system
namespace of our cluster specifying the version and repository where the Helm chart is hosted.To run this Pulumi program, you will need:
- Pulumi CLI installed
- AWS account and the AWS CLI configured
- Your chosen AWS region, user credentials, etc., should already be set up either via the AWS CLI or environment variables.
-