1. Deploy the zotero helm chart on AWS EKS

    TypeScript

    To deploy the Zotero Helm chart on an AWS EKS cluster, we will walk through the steps to create and configure the necessary AWS resources with Pulumi. We'll first set up an Amazon EKS cluster, then configure your Helm chart for deployment. Note that this deployment assumes you are using the Pulumi CLI and AWS CLI with the necessary permissions and configurations set up and that you have installed kubectl for interacting with your EKS cluster.

    Here's what we're going to do, step by step:

    1. EKS Cluster Setup: We will create the EKS cluster utilizing Pulumi's eks package.
    2. Helm Chart Deployment: Once the cluster is set up, we will deploy the Zotero Helm chart onto it using Pulumi's kubernetes package to interact with Helm charts.

    Let's start by creating the EKS Cluster:

    import * as eks from "@pulumi/eks"; // Create an EKS cluster with default settings. // The cluster will have an OIDC provider configured which is needed for service accounts. const cluster = new eks.Cluster("zotero-cluster", { createOidcProvider: true, }); export const kubeconfig = cluster.kubeconfig;

    Here, we create a basic EKS cluster with the OIDC provider enabled. The OIDC provider is necessary for IAM Roles for Service Accounts (IRSA), which may be needed if your Helm chart requires specific AWS permissions. The exported kubeconfig can be used to access the cluster with kubectl.

    Next, let's prepare for the Helm chart deployment:

    import * as kubernetes from "@pulumi/kubernetes"; // Use the generated kubeconfig to interact with the cluster. const kubeconfig = cluster.kubeconfig.apply(JSON.stringify); // Fetch and apply a Helm Chart from its repository. const zoteroChart = new kubernetes.helm.v3.Chart("zotero-chart", { chart: "zotero", version: "x.y.z", // Specify the correct chart version fetchOpts: { repo: "https://zotero-chart-repository/", // Replace with Zotero Helm chart's repository URL }, // Set values based on Zubero Helm chart documentation which may include // the image to use, any service types, ports, volumes, etc. values: { // Replace with actual values required or optional for the Zotero Helm chart. }, }, { provider: new kubernetes.Provider("k8s-provider", { kubeconfig }) }); // Export the Chart's status export const chartStatus = zoteroChart.status;

    Here is a breakdown of what each part does:

    • const kubeconfig: We stringify the generated kubeconfig from the cluster setup to use in the Helm chart deployment.
    • const zoteroChart: This creates the Helm chart resource. We specify the name of the chart (zotero), its version (which you will need to replace with the specific version you wish to deploy), and the repository where the chart is located.
    • values: This is where you would provide any configuration specific to the Zotero chart which overrides default values set by the Helm chart. Find these in the chart's documentation or by using helm show values.
    • provider: This tells Pulumi to use the generated kubeconfig for deploying the Helm chart.
    • export const chartStatus: After deployment, you may want to examine the status to ensure everything is running correctly.

    Remember to input the correct version of the Helm chart and the URL to the Zotero Helm chart repository where noted.

    With those resources defined in our Pulumi program, you can then deploy the EKS cluster and the Zotero Helm chart by running the following commands in your terminal:

    1. Initialize a new Pulumi project: pulumi new typescript
    2. Place the TypeScript code into the index.ts file in your Pulumi project directory.
    3. Deploy the stack: pulumi up

    After confirming the preview looks correct, select yes to start the deployment. Once the deployment is finished, you'll be able to interact with your EKS cluster using kubectl and the exported kubeconfig.