1. Deploy the kube-web-view helm chart on AWS EKS

    TypeScript

    To deploy the kube-web-view Helm chart on an Amazon EKS (Elastic Kubernetes Service) cluster using Pulumi, you'll first need to set up an EKS cluster, and then deploy the Helm chart to that cluster. We will use the @pulumi/eks package to create the cluster and the @pulumi/kubernetes package to deploy the Helm chart.

    Here's the overall process:

    1. EKS Cluster Setup: Use the eks.Cluster resource to create a managed EKS cluster.
    2. Kube Web View Helm Chart Deployment: With the cluster in place, use the kubernetes.helm.v3.Chart resource to deploy the kube-web-view Helm chart.

    The following Pulumi program written in TypeScript illustrates these steps:

    import * as pulumi from '@pulumi/pulumi'; import * as aws from '@pulumi/aws'; import * as eks from '@pulumi/eks'; import * as k8s from '@pulumi/kubernetes'; // Step 1: 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; // Step 2: Deploy the kube-web-view Helm chart to the EKS cluster const kubeWebViewInit = new k8s.Provider("kubeWebViewInit", { kubeconfig: cluster.kubeconfig.apply(JSON.stringify), }); const kubeWebViewChart = new k8s.helm.v3.Chart("kube-web-view", { chart: "kube-web-view", version: "1.0.0", // specify the exact chart version namespace: "default", fetchOpts: { repo: "https://honestbee.github.io/kube-web-view", // specify the Helm chart repository }, }, { provider: kubeWebViewInit }); // Export the Chart name export const kubeWebChartName = kubeWebViewChart.name;

    Explanation:

    1. Cluster Creation:

      • eks.Cluster creates a new EKS cluster. You can specify the number of nodes (desiredCapacity), the minimum (minSize) and maximum (maxSize) sizes of the cluster, the instance type to use for the EC2 instances that will be part of the EKS cluster, and additional settings.
      • storageClasses sets the storage class to gp2, which is a general-purpose SSD option provided by AWS.
      • deployDashboard is set to false to avoid deploying the Kubernetes dashboard since we want to use kube-web-view.
    2. Kubeconfig Export:

      • kubeconfig is exported so that it can be used by kubectl and other tools outside of Pulumi to interface with the cluster.
    3. Helm Chart Deployment:

      • We initialize a new Kubernetes provider (kubeWebViewInit) by providing it with the kubeconfig from our EKS cluster. This tells Pulumi how to communicate with our EKS cluster.
      • k8s.helm.v3.Chart is used to deploy the kube-web-view Helm chart. We need to specify the chart name, the chart version, the namespace to deploy into (optional), and the repository URL where the Helm chart is located.
    4. Export Chart Name:

      • We export the chart name as kubeWebChartName. This is useful for referencing the Helm deployment in other parts of your Pulumi program or in other Pulumi programs.

    This Pulumi program sets up both the EKS cluster and the kube-web-view Helm chart, ready to be used for monitoring Kubernetes resources. After running this program with Pulumi, you should have a working EKS cluster with the kube-web-view dashboard deployed. You can use the exported kubeconfig to connect to your cluster using kubectl.