1. Answers
  2. Deploy the ztncui helm chart on Digital Ocean Kubernetes Service

How do I deploy the ztncui helm chart on Digital Ocean Kubernetes Service?

To deploy the ztncui Helm chart on a DigitalOcean Kubernetes Service (DOKS) cluster using Pulumi, we’ll follow these steps:

  1. Create a DigitalOcean Kubernetes Cluster: We’ll provision a Kubernetes cluster on DigitalOcean.
  2. Deploy the ztncui Helm Chart: We’ll use Pulumi’s Kubernetes provider to deploy the Helm chart to our Kubernetes cluster.

Detailed Steps

  1. Setup Pulumi Project: Ensure you have Pulumi CLI installed and configured with your DigitalOcean access token.
  2. Create a DigitalOcean Kubernetes Cluster: We’ll define a Kubernetes cluster resource.
  3. Deploy the ztncui Helm Chart: We’ll use the @pulumi/kubernetes package to deploy the Helm chart.

Pulumi Program

Here is the Pulumi program written in TypeScript:

import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
import * as k8s from "@pulumi/kubernetes";

// Create a DigitalOcean Kubernetes Cluster
const cluster = new digitalocean.KubernetesCluster("my-cluster", {
    region: digitalocean.Region.NYC3,
    version: "1.22.5-do.0",
    nodePool: {
        name: "default",
        size: "s-2vcpu-4gb",
        nodeCount: 3,
    },
});

// Export the cluster's kubeconfig
export const kubeconfig = cluster.kubeConfigs[0].rawConfig;

// Create a Kubernetes provider instance using the kubeconfig
const k8sProvider = new k8s.Provider("k8sProvider", {
    kubeconfig: kubeconfig,
});

// Deploy the ztncui Helm chart
const ztncui = new k8s.helm.v3.Chart("ztncui", {
    chart: "ztncui",
    fetchOpts: {
        repo: "https://docs.openziti.io/release/helm-charts",
    },
    values: {
        // Add your custom values here
    },
}, { provider: k8sProvider });

export const ztncuiStatus = ztncui.getResource("v1/Pod", "ztncui-ztncui").status;

Explanation

  1. DigitalOcean Kubernetes Cluster:

    • We create a KubernetesCluster resource specifying the region, Kubernetes version, and node pool configuration.
  2. Kubeconfig:

    • We export the kubeconfig of the created cluster to use it with the Kubernetes provider.
  3. Kubernetes Provider:

    • We create a Kubernetes provider instance using the exported kubeconfig. This provider allows us to interact with the Kubernetes cluster.
  4. Helm Chart Deployment:

    • We deploy the ztncui Helm chart using k8s.helm.v3.Chart. We specify the chart name and the repository from which to fetch the chart.
  5. Exporting Status:

    • We export the status of the ztncui deployment to verify that the chart has been deployed successfully.

Running the Program

  1. Ensure you have the Pulumi CLI installed and configured.
  2. Clone or create a new Pulumi project and add the above code to your index.ts file.
  3. Run pulumi up to deploy the resources.

This program will create a DigitalOcean Kubernetes cluster and deploy the ztncui Helm chart to it, providing you with a Zero Trust Network Controller User Interface.

New to Pulumi?

Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.

Sign up