1. Deploy the ibm-eventstreams-operator helm chart on AWS EKS

    TypeScript

    To deploy an IBM Event Streams operator Helm chart on AWS Elastic Kubernetes Service (EKS), we would follow these general steps:

    1. Create an EKS cluster on AWS.
    2. Deploy the Helm chart to the EKS cluster.

    Below, I'll provide you with a Pulumi program written in TypeScript that captures these steps. This program assumes you already have Pulumi installed, and AWS CLI configured with the necessary permissions.

    First, we'll create an EKS cluster using Pulumi's EKS package, which provides higher-level abstractions to simplify EKS deployments. We'll also create the necessary roles and instances for the cluster.

    Once the cluster is up, we will deploy the IBM Event Streams operator Helm chart to it. This is done by including the Pulumi Kubernetes provider and using it to interact with the Helm chart from the Kubernetes package.

    Here is the complete TypeScript program that performs both of these actions:

    import * as eks from "@pulumi/eks"; import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; import * as k8s from "@pulumi/kubernetes"; // Step 1: Create an EKS cluster const cluster = new eks.Cluster("my-eks-cluster", { // Specify the desired settings for the EKS cluster; for example, the number of nodes desiredCapacity: 2, minSize: 1, maxSize: 2, instanceType: "t2.medium", }); // Export the clusters' kubeconfig. // This makes it possible to access the cluster using kubectl export const kubeconfig = cluster.kubeconfig; // Step 2: Deploy IBM Event Streams operator Helm chart to EKS const eventStreamsOperatorChart = new k8s.helm.v3.Chart("ibm-eventstreams-operator", { chart: "ibm-eventstreams-operator", version: "1.2.0", // Specify the version of the Helm chart you want to deploy fetchOpts: { // Replace with the URL pointing to your desired Helm chart repository repo: "https://raw.githubusercontent.com/IBM/charts/master/repo/stable/", }, }, { provider: cluster.provider }); // Wait for the EKS cluster to be created before deploying the Helm chart // This uses the `dependsOn` option to ensure correct execution order. const eventStreamsOperatorDeployment = eventStreamsOperatorChart.getResource("v1/Deployment", "ibm-eventstreams-operator"); // Export a URL of the deployed IBM Event Streams operator Helm chart export const eventStreamsOperatorUrl = pulumi.interpolate`http://${eventStreamsOperatorDeployment.status.loadBalancer.ingress[0].hostname}`;

    Explanation

    • We create an EKS cluster named my-eks-cluster with a desired capacity of 2 nodes using t2.medium instance types. You should choose an instance type and node count suitable for your workload and a region where you want your cluster to be located. The EKS role and other dependencies are automatically created by the eks.Cluster class.
    • We define the IBM Event Streams operator Helm chart, specifying which chart and version we want to deploy. In the fetchOpts, repo refers to the chart's repository URL; this should be the URL where your intended Helm chart can be found.
    • We set the provider of the Helm chart to be the Kubernetes provider instance related to the created EKS cluster. This ensures that the Helm chart is deployed to our EKS cluster.
    • We use getResource to retrieve the Deployment of the IBM Event Streams operator to access properties related to the deployment once it is up and running. For example, in this case, you could access the load balancer URL if your Helm chart deployment creates one.
    • We export two things:
      • kubeconfig: A kubeconfig file output that you would use to access your EKS cluster with kubectl.
      • eventStreamsOperatorUrl: A placeholder for a URL that might be used to access your IBM Event Streams once it's deployed. This depends on your actual Helm chart exposing a service with an external load balancer.

    Please keep in mind that the actual chart version ("1.2.0") and chart repository URL ("https://raw.githubusercontent.com/IBM/charts/master/repo/stable/") might differ based on the current version and location of the IBM Event Streams operator Helm chart.

    To apply this program:

    1. Save it as index.ts in a new Pulumi project directory.
    2. Run pulumi up to create the resources in your AWS account.

    Pulumi will show you a preview of the resources that will be created and ask for confirmation before proceeding. Once confirmed, it will execute the program and create an EKS cluster and deploy the IBM Event Streams operator Helm chart on it.