Hi all, I'm trying to install a Helm chart with Pu...
# general
Hi all, I'm trying to install a Helm chart with Pulumi that is the equivalent of:
Copy code
$ helm install postgres-operator <https://opensource.zalando.com/postgres-operator/charts/postgres-operator/postgres-operator-1.4.0.tgz> -f <https://opensource.zalando.com/postgres-operator/charts/postgres-operator/values-crd.yaml>
however, looking at https://www.pulumi.com/docs/guides/adopting/from_kubernetes/#provisioning-a-helm-chart and the available options I'm not sure how to achieve that? (Using the direct
reference) The chart is not in a repo, see https://github.com/zalando/postgres-operator/issues/552#issuecomment-521193807
You can use
to point to a
https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/kubernetes/helm/v2/#LocalChartOpts You'll need to unpack the
file first though
I actually just used this for some python, here's how it looks
Copy code
Chart("local-volume-provisioner", LocalChartOpts(
        "classes": [
                "name": 'local',
                "hostDir": "/mnt/",
                "volumeMode": "Filesystem",
                "fsType": "ext4",
Thanks, will give a try 👍
I ended up with this which works:
Copy code
import * as k8s from "@pulumi/kubernetes";
import * as kx from "@pulumi/kubernetesx";
import * as fs from "fs";
import * as path from "path";
import * as nodepath from "path";

const chartDir = path.resolve( "/tmp" );
// Fetch the Zalando Postgres Operator chart if it hasn't been fetched
if (!fs.existsSync(nodepath.join(chartDir, "postgres-operator"))) {
            destination: chartDir,
            untar: true,

// Install the CRD's manually
new k8s.yaml.ConfigGroup("postgres-operator-crds", {
    files: [ path.join(nodepath.join(chartDir, "postgres-operator/crds", "*.yaml")) ],

// Apply the templated Helm chart
const postgresOperator = new k8s.helm.v3.Chart("postgres-operator", {
    path: nodepath.join(chartDir, "postgres-operator"),
    values: crdValues(),

function crdValues(): any {
    let fileContents = fs.readFileSync(nodepath.join(chartDir,
    return require("js-yaml").safeLoad(fileContents);
Some annoying things: • I had to check if the
had already been downloaded and untarred as it tried to do it again after preview or next run and would fail because it already existed • Using
it seems that the state is tied to the directory location of the
. If the location of the
changes it's seen as a state update. Is this by design or am I missing something? Doesn't that force a consistent location for the manifests? • As above, I had to install the CRD's separately as
helm template
obviously doesn't install CRD's. Is there support for a more elegant way of achieving this? Perhaps as part of
? • I had to use a pre-existing values file (see original Helm install
... -f <https://opensource.zalando.com/postgres-operator/charts/postgres-operator/values-crd.yaml>
) so I had to read it and parse it as yaml (thanks to hint from https://github.com/pulumi/pulumi-kubernetes/issues/659#issuecomment-515701898) but built in support as described in that issue would have been welcome