Deploy the ibm-aspera-operator helm chart on Digital Ocean Kubernetes Service
TypeScriptTo deploy the IBM Aspera Operator Helm chart on the Digital Ocean Kubernetes Service using Pulumi, you will first create a Kubernetes cluster on Digital Ocean. Then, you will deploy the Helm chart to the cluster. Below is an explained step-by-step Pulumi TypeScript program that accomplishes these tasks.
Prerequisites
Before you run this program, make sure that:
- You have installed the Pulumi CLI and set up the Pulumi project.
- You have configured your Digital Ocean and Kubernetes provider credentials using the Pulumi CLI or environment variables.
- The Helm chart for the IBM Aspera Operator is available in a known repository or a local path. (For the sake of this example, we assume it's available in a public repository)
Creating a Digital Ocean Kubernetes Cluster
You will start by creating a Kubernetes cluster in Digital Ocean by using the
digitalocean.KubernetesCluster
resource. This requires specifying parameters such as the region, version of Kubernetes, and the node pool configuration.Deploying the Helm Chart
After the cluster is provisioned, you will deploy the IBM Aspera Operator Helm chart using the
kubernetes.helm.v3.Chart
resource from the Pulumi Kubernetes provider. This allows you to manage Helms charts in a declarative way. You need to provide details such as the chart name, repository URL, and any values you want to override in the default chart configuration.Program
Here's the TypeScript program:
import * as digitalocean from "@pulumi/digitalocean"; import * as kubernetes from "@pulumi/kubernetes"; // Step 1: Create a Digital Ocean Kubernetes cluster const cluster = new digitalocean.KubernetesCluster("do-cluster", { // Recommended to choose the region closest to your users region: digitalocean.Regions.NYC1, // Choose the version of Kubernetes you want to deploy version: "1.21.5-do.0", // Define the size and number of Droplets (nodes) in the node pool nodePool: { name: "default", size: digitalocean.DropletSlugs.DropletS2VCPU2GB, nodeCount: 1, }, }); // Step 2: Deploy the IBM Aspera Operator Helm chart on the created cluster const asperaChart = new kubernetes.helm.v3.Chart("aspera-operator", { // Specify the chart repository and name chart: "ibm-aspera-operator", // The version of the chart, if known version: "1.0.0", // Optional: specific values to override in the chart values: { // Sample value override, replace with actual values service: { type: "LoadBalancer", }, }, // Fetch the default kubeconfig from the created cluster fetchOpts:{ kubeconfig: cluster.kubeConfigs[0].rawConfig, }, }, { provider: cluster }); // Export the cluster's kubeconfig and the Helm release status export const kubeConfig = cluster.kubeConfigs[0].rawConfig; export const helmReleaseStatus = asperaChart.status;
In this program:
- A new Kubernetes cluster is created in the NYC1 region of Digital Ocean, with a single node pool that has one node of size
s-2vcpu-2gb
. - A new Helm release of the IBM Aspera Operator is created using the specified chart and version. Make sure to replace the
version
with the actual chart version you wish to deploy. - The
values
object within the Helm chart instantiation is a placeholder; you'll need to replace the contents with the actual configuration values specific to the IBM Aspera Operator Helm chart you're deploying. - The
kubeconfig
is fetched from the newly created Digital Ocean Kubernetes cluster to configure Kubernetes provider to deploy Helm charts on the remote cluster. - The outputs,
kubeConfig
andhelmReleaseStatus
, are exported by the Pulumi program so you can access the cluster's configuration and Helm release status after deployment.
Once you've composed this program into a
.ts
file, you can run it with Pulumi CLI commands:pulumi up
to create the resources as specified in the program.- After deployment, you can use
pulumi stack output kubeConfig
to obtain the kubeconfig for your new Kubernetes cluster. - You can also use
pulumi stack output helmReleaseStatus
to get the status of your Helm release.
Make sure to replace placeholders and add any necessary configurations tailored to the IBM Aspera Operator Helm chart.