Deploy the crossplane-aws-factory helm chart on Kubernetes
TypeScriptTo deploy the
crossplane-aws-factory
Helm chart on Kubernetes using Pulumi, you can use thekubernetes.helm.v3.Chart
resource from the@pulumi/kubernetes
package. This resource allows you to deploy Helm charts in a declarative way with Pulumi.Before you begin, make sure you have Pulumi installed and configured with access to a Kubernetes cluster. You must also have access to the Helm repository hosting the
crossplane-aws-factory
chart, or have the chart available locally.Here's what you need to do:
- Import the
@pulumi/kubernetes
package, which provides support for all Kubernetes resources. - Create a new
kubernetes.helm.v3.Chart
resource, specifying the name, chart, and optionally repository and version of the Helm chart you want to deploy.
The following TypeScript program demonstrates how to achieve this:
import * as kubernetes from "@pulumi/kubernetes"; // A Pulumi program to deploy the `crossplane-aws-factory` Helm chart on a Kubernetes cluster. const chart = new kubernetes.helm.v3.Chart("crossplane-aws-factory", { // Provide the chart name; this is the Helm chart to be deployed. chart: "crossplane-aws-factory", // Specify the repository where the Helm chart is hosted. // This should be the URL of the repository. // You can skip this if the chart is already added to your Helm's local repository, // or if you are using a chart available from a local path. repo: "https://charts.crossplane.io/stable", // You can optionally specify a version of the chart to deploy. // If this is omitted, the latest version will be deployed. version: "1.0.0", // Values allow you to provide a custom configuration for the Helm chart. // This example provides an empty set of values, but you would typically customize // these to your requirements. values: {}, // Use namespace where you want to deploy the chart, if not provided it will be deployed // in the default namespace. namespace: "crossplane-system" }); // After running `pulumi up`, this will output the status of the deployed Helm chart. export const crossplaneFactoryStatus = chart.status;
In the script above, we're creating a Helm chart resource named
crossplane-aws-factory
. We have specified the repository URL where the chart can be found and also the version we want to install. Thevalues
object is where you can override any of the default values provided by the Helm chart with your own configuration.Note that the
namespace
field is optional, and if you don't set it, the Helm chart will be installed in the default namespace. You should replace therepo
URL with the actual URL of the Helm chart repository wherecrossplane-aws-factory
is located, and use the correct version corresponding to the chart you want to install.To apply this Pulumi program:
- Save the code in a file named
index.ts
. - Run
pulumi up
in the terminal in the same directory as the file. - Pulumi CLI will show you a preview of the resources that will be created.
- If everything looks good, confirm the deployment by selecting
yes
.
Please refer to the official Pulumi Kubernetes documentation for more details on deploying Helm charts using Pulumi.
- Import the