1. Pulumi Templates
  2. Kubernetes Application Templates
  3. Helm Chart on Kubernetes

Helm Chart on Kubernetes

Available inTypeScript, Python, Go, C#, YAML

The Helm Chart template scaffolds a Pulumi project that deploys a Helm chart to an existing Kubernetes cluster using Pulumi’s Kubernetes provider. The template creates a new namespace in the cluster and installs an Nginx ingress controller as the default chart, so the project deploys end to end out of the box.

An architecture diagram of the Helm Chart template

Using this template

To use this template, make sure you’ve already provisioned a Kubernetes cluster, installed Pulumi and kubectl, and configured your kubeconfig file. Then create a new project using the template in the language of your choice:

$ mkdir my-k8s-app && cd my-k8s-app
$ pulumi new helm-kubernetes-typescript
Alternatively, you can create and configure a new project with this template (helm-kubernetes-typescript) in Pulumi Cloud.
$ mkdir my-k8s-app && cd my-k8s-app
$ pulumi new helm-kubernetes-python
Alternatively, you can create and configure a new project with this template (helm-kubernetes-python) in Pulumi Cloud.
$ mkdir my-k8s-app && cd my-k8s-app
$ pulumi new helm-kubernetes-go
Alternatively, you can create and configure a new project with this template (helm-kubernetes-go) in Pulumi Cloud.
$ mkdir my-k8s-app && cd my-k8s-app
$ pulumi new helm-kubernetes-csharp
Alternatively, you can create and configure a new project with this template (helm-kubernetes-csharp) in Pulumi Cloud.
$ mkdir my-k8s-app && cd my-k8s-app
$ pulumi new helm-kubernetes-yaml
Alternatively, you can create and configure a new project with this template (helm-kubernetes-yaml) in Pulumi Cloud.

Follow the prompts to complete the new-project wizard. When it’s done, you’ll have a complete Pulumi project that’s ready to deploy and configured with the most common settings. Feel free to inspect the code in index.js index.ts __main__.py main.go Program.cs Program.fs Program.vb App.java Pulumi.yaml for a closer look.

Deploying the project

The template requires no additional configuration. By default, it will install an Nginx ingress controller with Helm. Once the new project is created, you can deploy it with pulumi up:

$ pulumi up

When the deployment completes, Pulumi exports the following stack output values:

name
The name of your new Helm chart deployment.

Output values like these are useful in many ways, most commonly as inputs for other stacks or related cloud resources.

Customizing the project

Projects created with the Helm Chart template expose the following configuration settings:

k8sNamespace
The name of the namespace to be created in your existing cluster. Defaults to nginx-ingress.

All of these settings are optional and may be adjusted either by editing the stack configuration file directly (by default, Pulumi.dev.yaml) or by changing their values with pulumi config set:

$ pulumi config set k8sNamespace my-namespace
$ pulumi up

You can customize the Helm chart by passing values to it in your Pulumi code. An example of passing a few values to the chart is included in the template for reference.

Cleaning up

You can cleanly destroy the stack and all of its infrastructure with pulumi destroy:

$ pulumi destroy

Learn more