pulumi / pulumi-kubernetes

A Pulumi resource provider for Kubernetes to manage API resources and workloads in running clusters
https://www.pulumi.com/docs/reference/clouds/kubernetes/
Apache License 2.0
407 stars 117 forks source link

Support --dry-run=server for Helm charts #2766

Open kwohlfahrt opened 9 months ago

kwohlfahrt commented 9 months ago

Hello!

Issue details

Trying to install the "GitHub Actions Scale Set" Helm chart with Pulumi fails with the following error:

    error: failed to create chart from template: execution error at (gha-runner-scale-set/templates/manager_role_binding.yaml:17:11): No gha-rs-controller deployment found using label (app.kubernetes.io/part-of=gha-rs-controller). Consider setting controllerServiceAccount.name in values.yaml to be explicit if you think the discovery is wrong.

This reproduces with the Helm CLI, when using --dry-run=client (or just --dry-run). For example:

$ helm install -n actions-runner foo oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set --set githubConfigSecret=github-access --set githubConfigUrl=https://github.com/CHARM-Tx --dry-run
Pulled: ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set:0.8.1
Digest: sha256:36a1f7a07ae5a3b15a9d190cf492ab66dd3a1302f37bde2f1ce5a6660592eb10
Error: INSTALLATION FAILED: execution error at (gha-runner-scale-set/templates/manager_role_binding.yaml:17:11): No gha-rs-controller deployment found using label (app.kubernetes.io/part-of=gha-rs-controller). Consider setting controllerServiceAccount.name in values.yaml to be explicit if you think the discovery is wrong.

The issue is that the chart uses lookup functionality, which requires contacting the Kubernetes API server. Passing --dry-run=server allows lookups to succeed, as of helm/helm#9426.

I would like Pulumi to also support this option, so I can install the Helm chart with Pulumi.

Affected area/feature

This affects the helm.v3.Release resource (and possibly helm.v3.Chart).

mjeffryes commented 9 months ago

thanks for filing this ticket @kwohlfahrt, I'll add it to our backlog.

EronWright commented 2 months ago

Note that Chart/v4 uses --dry-run=server to allow the lookup function to work normally. Also, preview mode works in the same way.