1. Deploy the kube-arangodb helm chart on AWS EKS

    TypeScript

    To deploy the kube-arangodb Helm chart on AWS EKS using Pulumi, you need to create an EKS cluster and then deploy the chart onto that cluster. The process involves creating the relevant AWS resources, such as an EKS cluster, node groups, and associated IAM roles, and then using the Pulumi Kubernetes provider to deploy the chart.

    Below is a detailed Pulumi program in TypeScript that accomplishes this. The program includes:

    1. EKS Cluster: Creation of an EKS cluster leveraging the @pulumi/eks package. This abstracts away much of the complexity for you.
    2. Node Group: Adding a managed node group to the cluster for hosting the Kubernetes workloads.
    3. Helm Chart: Deploying the kube-arangodb chart from within the Kubernetes cluster.

    First, ensure you have AWS and Kubernetes Pulumi providers configured properly. Then the following program can be used:

    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, }); // Create a Kubernetes provider instance that uses our EKS cluster. const k8sProvider = new k8s.Provider("k8s-provider", { kubeconfig: cluster.kubeconfig.apply(JSON.stringify), }); // Deploy kube-arangodb Helm chart using the Pulumi Kubernetes provider. const chart = new k8s.helm.v3.Chart( "kube-arangodb", { chart: "kube-arangodb", version: "1.1.2", // Replace with a specific chart version if required. fetchOpts: { repo: "https://kubernetes-charts.storage.googleapis.com/", // Adjust the Helm repository if needed. }, }, { provider: k8sProvider } ); // Export the cluster's kubeconfig. export const kubeconfig = cluster.kubeconfig;

    Explanation

    • The eks.Cluster class creates a new AWS EKS cluster. We specify the desired instance type and the number of desired instances (along with minimum and maximum for scaling purposes).

    • We then create a k8s.Provider, which is needed by Pulumi to interact with our Kubernetes cluster. We provide it with the kubeconfig output from our EKS cluster.

    • The kube-arangodb Helm chart is deployed using the k8s.helm.v3.Chart class. This will install the database system in our EKS cluster. We specify the chart name, an optional version, and the repository where the chart can be found.

    • Finally, we export the kubeconfig, which allows you to interact with your Kubernetes cluster using kubectl or any other Kubernetes tooling.

    After Deployment

    Once you've deployed the above program with Pulumi, you should have a running EKS cluster with the kube-arangodb Helm chart installed. To use the cluster:

    1. Run pulumi stack output kubeconfig to get the kubeconfig file necessary to interact with your cluster.
    2. Save the output to a file and point the KUBECONFIG environment variable to it, e.g., export KUBECONFIG=./kubeconfig.json.
    3. Use kubectl to interact with the cluster, for example, kubectl get all should now show you resources related to kube-arangodb.

    Remember to replace the chart version and Helm repository with the correct ones if the provided defaults don't match the actual Helm chart you're wishing to deploy.

    For more information on the Pulumi EKS package, see the EKS package documentation. To learn more about using Helm charts with Pulumi, check out the Helm Chart documentation.