1. Deploy the instana-agent-operator helm chart on AWS EKS

    TypeScript

    To deploy the instana-agent-operator Helm chart on AWS EKS, you'll need to follow a sequence of steps. We'll first create an Amazon EKS cluster and then deploy the Helm chart onto the cluster.

    The following Pulumi TypeScript program illustrates how to:

    1. Create an EKS cluster.
    2. Deploy the instana-agent-operator Helm chart to the cluster.

    Before running the program, make sure you have:

    • Installed the Pulumi CLI and set up your AWS credentials.
    • Installed Node.js and the npm package manager to run TypeScript programs.
    • Installed the required Pulumi packages for your project.

    Let's start by creating a new EKS cluster:

    import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; import * as eks from "@pulumi/eks"; 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: 3, storageClasses: "gp2", deployDashboard: false, }); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig;

    This code sets up a new EKS cluster with the specified instance types and capacity settings. Adjust these settings based on your requirements. We have set deployDashboard to false to skip deploying the Kubernetes dashboard, but you can enable it if needed.

    Now, to deploy the instana-agent-operator Helm chart to your new EKS cluster, you will use the Chart resource from the Pulumi Kubernetes provider.

    // Create a Kubernetes provider instance that uses our EKS cluster. const provider = new k8s.Provider("k8s-provider", { kubeconfig: cluster.kubeconfig, }); // Deploy the instana-agent-operator Helm chart. const instanaAgentChart = new k8s.helm.v3.Chart("instana-agent-operator", { chart: "instana-agent-operator", version: "1.0.1", // replace with the specific version you want to deploy namespace: "instana-agent", fetchOpts: { repo: "https://helm.instana.io", // replace with the correct Helm repository for Instana }, }, { provider }); // Export the status of the deployed Helm chart. export const instanaChartStatus = instanaAgentChart.status;

    In this block of code, we're creating a Provider that allows Pulumi to communicate with the Kubernetes API server of our new EKS cluster. With this provider, we deploy the instana-agent-operator Helm chart to the instana-agent namespace in the cluster. Make sure to replace the version with the desired version of the Helm chart you wish to deploy, and the repo with the correct Helm repository URL for Instana.

    After this, you can run the Pulumi program with pulumi up, ensuring that you are in the same directory as the code. The program will provision the EKS cluster and deploy the Helm chart, and you will be able to see the infrastructure changes output by Pulumi.

    Remember to check the instana-agent-operator Helm chart's documentation for any specific configuration that you might need to provide through the values property in the Chart resource. If the chart requires additional setup (like providing an Instana Agent Key), you'll need to include that in the inputs to the Chart.

    By running the above program, you'll have successfully deployed the instana-agent-operator Helm chart onto your AWS EKS cluster.