https://pulumi.com logo
Title
p

purple-plumber-90981

09/17/2021, 2:48 AM
in messing with the new helm.release functionality i would like to know if there is a way to get the rendered yaml (before it is deployed - like a noop run) to debug issues like :-
Previewing update (ipd-eks-use1-sfx):
     Type                              Name                          Plan       Info
 +   pulumi:pulumi:Stack               pulumi-test-ipd-eks-use1-sfx  create     1 message
 +   ā”œā”€ pulumi:providers:kubernetes    k8s_provider                  create
     └─ kubernetes:<http://helm.sh/v3:Release|helm.sh/v3:Release>  signalfx-agent                           1 error

Diagnostics:
  kubernetes:<http://helm.sh/v3:Release|helm.sh/v3:Release> (signalfx-agent):
    error: Object 'Kind' is missing in 'null'
the associated code (simplified for readability)
helm_signalfx = k8s.helm.v3.Release(
    "signalfx-agent",
    args=k8s.helm.v3.ReleaseArgs(
        chart="signalfx-agent",
        repository_opts=k8s.helm.v3.RepositoryOptsArgs(
            repo="<https://dl.signalfx.com/helm-repo>",
        ),
        name="signalfx-agent",
        namespace="observability",
        values={
            "clusterName": pulumi_stack_info['name'],
        },
        timeout=600,
        version="1.9.2",
    ),
    opts=pulumi.ResourceOptions(provider=k8s_provider),
)
p

prehistoric-translator-89978

09/17/2021, 3:01 AM
p

purple-plumber-90981

09/17/2021, 3:41 AM
yeah so trying to leverage the
enable_dry_run
or the
render_yaml_to_directory
on the provider seems ineffectual
<https://www.pulumi.com/docs/reference/pkg/kubernetes/provider/>
describes both of these features as
BETA FEATURE
. . . do i need to do something at a config level to ensure beta features are used ?
p

prehistoric-translator-89978

09/17/2021, 3:52 AM
The issue is that render to yaml is a provider itself so you would have to do
provider = Provider("yaml", render_yaml_to_directory = "yaml")
so that will delete your existing stack (but you'll get yaml files. šŸ™‚ )
p

purple-plumber-90981

09/17/2021, 3:58 AM
ok ill give that a go
doesnt seem to do anything
im using
render_provider = k8s.Provider(
    "render_provider",
    render_yaml_to_directory='yaml',
)
same code i show above but pointing to render_provider
ie
opts=pulumi.ResourceOptions(provider=render_provider)
p

prehistoric-translator-89978

09/17/2021, 4:22 AM
Yeah that's what I do. So it didn't create a directory called `yaml`and rendered the files in there?
Oh, you need to replace
"render_provider"
with
"yaml"
p

purple-plumber-90981

09/17/2021, 4:27 AM
its not a label ?
we are seeing
I0917 13:25:01.428923   33851 provider_plugin.go:569] Provider[kubernetes, 0xc000b24120].Check(urn:pulumi:ipd-eks-use1-sfx::pulumi-test::kubernetes:he
<http://lm.sh/v3:Release::signalfx-agent|lm.sh/v3:Release::signalfx-agent>) failed: err=Object 'Kind' is missing in 'null'
in the debug logging
ok im trying
render_provider = k8s.Provider(
    "yaml",
    render_yaml_to_directory='yaml',
)
it is not creating a directory or populating said rectory with any yaml
s

sparse-park-68967

09/17/2021, 4:30 AM
So this is the same issue as https://github.com/pulumi/pulumi-kubernetes/issues/1715. I have a fix which should release tomorrow
for debugging, yes we aren't yet supporting the render to yaml directory flag yet for helm release. Cut https://github.com/pulumi/pulumi-kubernetes/issues/1716 to track that.
šŸ‘ 1
To debug you could also just run
helm template
on the CLI ... with the provided values. In this case you will find there are some empty templates being rendered which the provider doesn't handle well - will be fixed tomorrow!
Thanks for your patience
p

purple-plumber-90981

09/17/2021, 4:41 AM
thanks @sparse-park-68967… we will try again on our Monday and see if problem is gone
s

sparse-park-68967

09/17/2021, 4:42 AM
please do! I will update this thread when the release is cut tomorrow.
@purple-plumber-90981 v3.7.2 has just been cut and should fix this and another couple of problems with the helm release resource
p

purple-plumber-90981

09/18/2021, 2:34 AM
hey so one other thing I noticed... @sparse-park-68967... namespace=mynamespace.id is not lifting properly. is that fixed also?
s

sparse-park-68967

09/18/2021, 2:35 AM
You mean setting the namespace of the release?
p

purple-plumber-90981

09/18/2021, 2:35 AM
else implicitly dependency on namespace is broken
referencing namespace object by id
s

sparse-park-68967

09/18/2021, 2:35 AM
it should work, do you have some code to point me at?
p

purple-plumber-90981

09/18/2021, 2:37 AM
not currently. on chairlift at snow. will drop you some code Monday. but easy to replicate. make a namespace and then a release. in your release reference namespace=newnamespace.id
it should lift and create a dependency. it fails with "must be a string"
IE does not allow pulumi namespace resource output as the release namespace parameter input
s

sparse-park-68967

09/18/2021, 2:47 AM
Pretty sure that works. Will point you at an example
We can sync up monday if I am mistaken!
Enjoy the snow!
Sorry to ping again, but this is the example we covered in the blog post - https://www.pulumi.com/blog/full-access-to-helm-features-through-new-helm-release-resource-for-kubernetes/#how-do-i-use-it which definitely works as expected. Lets sync up monday if you are seeing issues still