Deploy the zeppelin helm chart on AWS EKS
TypeScriptTo deploy the Zeppelin helm chart on an Amazon EKS (Elastic Kubernetes Service) cluster using Pulumi, you will need to perform the following high-level steps:
- Create an EKS cluster using Pulumi's AWS or
eks
package. - Deploy the Helm chart for Zeppelin onto the EKS cluster.
Below are the explanations and the corresponding TypeScript program that you can use to accomplish this.
EKS Cluster Creation
First, you need to create an EKS cluster. You use
eks.Cluster
from the Pulumi EKS package which provides a high level abstraction over creating an EKS cluster. Before you can use theeks.Cluster
resource, you need to set up an IAM role that EKS will assume for creating and managing resources.import * as aws from "@pulumi/aws"; import * as eks from "@pulumi/eks"; import * as pulumi from "@pulumi/pulumi"; import * as k8s from "@pulumi/kubernetes"; // Create an EKS cluster const cluster = new eks.Cluster("my-cluster", { instanceType: "t2.medium", desiredCapacity: 2, minSize: 1, maxSize: 2, }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig;
In this code block, an EKS cluster is created with EC2 instances of type
t2.medium
. ThedesiredCapacity
sets how many instances to aim for, whileminSize
andmaxSize
define the scaling range for the cluster's Auto Scaling Group.Deploying Helm Chart on EKS
Once you have the cluster, you can deploy applications using Helm charts. To deploy the Zeppelin helm chart, you use the
Chart
resource from Pulumi's Kubernetes package.// Use the generated kubeconfig to connect to the EKS cluster const provider = new k8s.Provider("eks-provider", { kubeconfig: cluster.kubeconfig.apply(JSON.stringify), }); // Deploy the Zeppelin Helm chart const zeppelinChart = new k8s.helm.v3.Chart("zeppelin", { chart: "zeppelin", version: "2.1.0", // specify the version of the chart fetchOpts: { repo: "https://helm.zeppelin.io", }, }, { provider }); // ensure that the Helm chart is deployed using the EKS cluster
This Helm chart deployment will install Zeppelin on your EKS cluster using the specified version. The
fetchOpts
specifies where to fetch the chart from, withrepo
being the Helm repository URL that holds the Zeppelin chart.Combining these code snippets results in the following complete Pulumi program:
import * as aws from "@pulumi/aws"; import * as eks from "@pulumi/eks"; import * as pulumi from "@pulumi/pulumi"; import * as k8s from "@pulumi/kubernetes"; // Create an EKS cluster const cluster = new eks.Cluster("my-cluster", { instanceType: "t2.medium", desiredCapacity: 2, minSize: 1, maxSize: 2, }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig; // Use the generated kubeconfig to connect to the EKS cluster const provider = new k8s.Provider("eks-provider", { kubeconfig: cluster.kubeconfig.apply(JSON.stringify), }); // Deploy the Zeppelin Helm chart const zeppelinChart = new k8s.helm.v3.Chart("zeppelin", { chart: "zeppelin", version: "2.1.0", // specify the version of the chart fetchOpts: { repo: "https://helm.zeppelin.io", }, }, { provider }); // ensure that the Helm chart is deployed using the EKS cluster
Now, with this Pulumi program, you're creating an EKS cluster and deploying the Zeppelin Helm chart to it. The Pulumi EKS and Kubernetes packages handle the intricate parts of setting up EKS and deploying helm charts. The
kubeconfig
is exported so that you can interact with your cluster usingkubectl
from your local machine if necessary.To run the program:
- Install Pulumi and set up the AWS CLI with your credentials.
- Save the TypeScript code to a file named
index.ts
. - Run
pulumi up
in the command line from the directory where your file is saved to deploy the cluster and the helm chart.
Please note that the actual parameters for the cluster creation and Zeppelin Chart might need to be adjusted based on the actual specifications and configurations you desire for your use case.
- Create an EKS cluster using Pulumi's AWS or