Deploy the weaviate-cluster helm chart on Kubernetes
TypeScriptTo deploy a Helm chart on Kubernetes using Pulumi, you'll need to create a Pulumi program that defines the necessary resources and configurations. In this case, we'll deploy the
weaviate-cluster
Helm chart.Here's a step-by-step guide along with a Pulumi program in TypeScript to achieve this:
Prerequisites
- Ensure you have Pulumi CLI installed and configured.
- Ensure you have
kubectl
installed and configured with access to your Kubernetes cluster. - Ensure you have a Kubernetes cluster running and available to deploy to.
Step 1: Set Up Your Pulumi Project
If you haven't already, set up a new Pulumi project using the Pulumi CLI:
$ pulumi new typescript
Step 2: Define the Pulumi Program
In the Pulumi program, we'll use the
@pulumi/kubernetes
package to interact with the Kubernetes API and deploy the Helm chart. Here's what the program will look like:-
Import the necessary modules - We need the
@pulumi/kubernetes
module to work with Kubernetes resources. -
Create a Helm chart resource - We define a Helm chart resource using the
Chart
class, specifying details such as the chart name, version, values, and the namespace to deploy it in.
Now let's see the code for deploying the
weaviate-cluster
Helm chart.import * as k8s from "@pulumi/kubernetes"; // Helm Chart name and version (specify the version you want to deploy) const chartName = "weaviate-cluster"; const chartVersion = "1.0.0"; // Replace with the desired chart version // Create a Helm Chart resource using the `Chart` class from the Pulumi Kubernetes SDK. // This will install the `weaviate-cluster` Helm chart in the Kubernetes cluster. const weaviate = new k8s.helm.v3.Chart(chartName, { chart: chartName, version: chartVersion, // Uncomment and specify the repository options if the chart is not from the default Helm repo // fetchOpts: { // repo: "https://helm.weaviate.io/" // }, // Specify custom values using the `values` property or omit if you want to use default values. // values: { // key: "value", // }, }); // Export the Helm chart's name and status export const weaviateChartName = weaviate.metadata.name; export const weaviateChartStatus = weaviate.status.ready;
In the code above,
- We import the
@pulumi/kubernetes
package to interact with Kubernetes resources. - We create a new Helm chart instance specifying the
chartName
and thechartVersion
. If the Helm repository for the chart is not the default Helm repository, you need to uncomment and fill therepo
URL infetchOpts
. - We also have the option to provide custom
values
that override the default configuration of the Helm chart. Uncomment and specify the necessary values according to your requirements. - Finally, we export the Helm chart's name and readiness status for easy access after deployment.
Step 3: Run Pulumi Up
Once the Pulumi program is ready, you can deploy the Helm chart to your Kubernetes cluster by running:
$ pulumi up
This command will prompt you to review the changes and proceed with the deployment.
Step 4: Check the Deployment
After the deployment completes successfully, you can use
kubectl
to check the status of the deployed resources:$ kubectl get all -n <namespace> # Replace <namespace> with the namespace you used for deployment
Remember that Helm charts often come with a set of configurable values. You should check the specific Helm chart documentation for
weaviate-cluster
to understand all the options you can configure.That's it! You've now deployed the
weaviate-cluster
Helm chart onto your Kubernetes cluster using Pulumi.