Deploy the private-gpt helm chart on Kubernetes
TypeScriptTo deploy the
private-gpt
Helm chart on Kubernetes using Pulumi, you will leverage thekubernetes.helm.v3.Chart
resource from the Pulumi Kubernetes provider. This resource allows Pulumi to install, update, and manage Helm charts in a Kubernetes cluster.The following program demonstrates how to deploy a Helm chart named
private-gpt
. You'll need to have your Kubernetes cluster configured and accessible viakubectl
, and Pulumi will interact with this existing cluster to perform the deployment.Make sure that you've got access to the Helm chart repository where
private-gpt
is hosted, or if it's a local chart, that you have the path to the chart directory. In this example, we'll assume the chart is available in a remote repository.Before running the Pulumi program, ensure you have installed the Pulumi CLI and logged in, and that you have the necessary Kubernetes context set up for the target cluster.
Here's the TypeScript program to deploy the
private-gpt
Helm chart:import * as k8s from '@pulumi/kubernetes'; // Define the Helm chart release using the `kubernetes.helm.v3.Chart` class. const privateGptChart = new k8s.helm.v3.Chart('private-gpt-chart', { // If the chart is from a remote Helm repository, specify `repo` and `chart`, and optionally `version`. repo: 'my-helm-repo', // Replace with the helm repository name that contains the `private-gpt` chart chart: 'private-gpt', version: '1.0.0', // Specify the chart version, make sure it matches the version you want to deploy // If you need to override default values or set custom configuration, use the `values` field. values: { // Here you can override the default values provided by the `private-gpt` Helm chart. // For example: // replicaCount: 2, // image: { // repository: 'my-docker-repo/private-gpt', // tag: 'latest', // }, // ... other values as needed. }, // If your Helm chart needs to be deployed into a specific namespace, specify it here. namespace: 'default', // Replace with the namespace where you want to deploy the chart // If your Helm chart includes CRDs and you want to upgrade those CRDs across releases, set `skipAwait` to false. // If the CRDs do not change, setting `skipAwait` to true can skip awaiting the resources and reduce deployment time. skipAwait: true, // `transformations` can be used to programmatically modify the resources before they are deployed. // For basic Helm chart deployments, this field may not be needed. // transformations: [ // (resource) => { // // Example transformation logic here // }, // ], }); // This outputs the status of the deployed Helm release. export const releaseStatus = privateGptChart.status;
The above program defines a new Helm chart release using the
kubernetes.helm.v3.Chart
class. You need to replace the placeholder values such asmy-helm-repo
with the actual repository where your Helm chart is located, specify the version of the chart you want to deploy, and set any custom values required for your chart deployment.To run this Pulumi program, follow these steps:
- Save the program in a file with a
.ts
extension, for example,deploy-private-gpt.ts
. - Run
pulumi up
in the terminal in the directory containing the file. This command will initiate the deployment process. - Confirm the deployment when prompted by the Pulumi CLI. Pulumi will then deploy the Helm chart to the configured Kubernetes cluster.
Once the deployment is complete, Pulumi will output the status of the Helm release, including any resources created as part of the Helm chart deployment. You can also inspect the resources directly using
kubectl
or other Kubernetes tooling.- Save the program in a file with a