Deploy the turbonomic-importer helm chart on Kubernetes
TypeScriptTo deploy a Helm chart on Kubernetes using Pulumi, you would typically use the
Chart
resource from the Pulumi Kubernetes provider. This resource allows you to deploy a Helm chart from various sources such as a repository or a local path, while also giving you the ability to customize the deployments with your preferred configurations by overriding the default values.In this example, you will need a Kubernetes cluster where the Helm chart will be deployed. For simplicity, we'll assume that you already have access to a Kubernetes cluster and your
kubeconfig
is set up correctly to communicate with the cluster. If you do not have a cluster, you can create one using Pulumi'seks.Cluster
resource for Amazon EKS,azure-native.containerservice.ManagedCluster
for Azure AKS, or similar resources for other cloud providers.We will be deploying the
turbonomic-importer
Helm chart. For this example, let's assume that this chart is available in a public Helm repository, and you wish to install the chart using its default configuration. If you need to customize any values, you can include avalues
object to override the default chart values.Here's a Pulumi program in TypeScript that performs the deployment:
import * as k8s from "@pulumi/kubernetes"; // This is the name of the Helm chart we want to deploy. Change this to the chart name you intend to deploy. const chartName = "turbonomic-importer"; // This is the name of the release for this deployment. const releaseName = "turbonomic-importer-release"; // Optionally, specify the Helm repository URL where your chart is located. const repoUrl = "https://example.com/helm-charts"; // Replace with the actual URL // Deploying the turbonomic-importer Helm chart to the Kubernetes cluster. const turbonomicImporterChart = new k8s.helm.v3.Chart(releaseName, { repo: "turbonomic", // Replace with the name of the repository where your chart is located chart: chartName, // You can specify a specific version of the chart if desired. version: "1.0.0", // Replace with the chart version you want to deploy // If you need to customize values, uncomment and modify the values object below. //values: { // key: "value", //}, }, { // This is the namespace where the chart will be installed. // By default, Helm charts are deployed to the "default" namespace. // If you'd like to target a different namespace, provide it here. namespace: "default", }); // Export the URL to access the deployed chart if applicable export const chartUrl = "http://<External-IP>/"; // Replace <External-IP> with actual access point
This program will create a new Helm chart deployment using the Pulumi Kubernetes provider.
Explanation of the program:
- We start by importing the Pulumi Kubernetes package that allows us to communicate with our Kubernetes cluster.
- We declare a few constants for the
chartName
,releaseName
, andrepoUrl
. These are placeholders, and you should replace them with the actual values for the chart you want to deploy. - We create a new
Chart
resource usingnew k8s.helm.v3.Chart
. This allows us to specify the details of the Helm chart we want to deploy. - In the
Chart
constructor, we pass:releaseName
- a unique name for the Helm release.- An object that includes details such as the repository (
repo
), the chart name (chart
), and optionally the chart version (version
). - An optional
values
object to override default chart values if customization is needed (commented out in the example). - An options object to specify the Kubernetes namespace for the deployment.
- Finally, an export is provided that could be used to output the URL for accessing the deployed application. Replace
<External-IP>
with the actual IP if the service is exposed externally.
To use this program, you would typically run it with the Pulumi CLI. Ensure you have Pulumi installed, and run
pulumi up
to apply the program and perform the deployment. The Pulumi CLI would then perform all necessary steps to contact your Kubernetes cluster and deploy the specified Helm chart.