Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm.v3.Chart doesn't render charts with "helm.sh/hook": pre-install,pre-upgrade in annotations #1335

Closed
zarkone opened this issue Sep 30, 2020 · 10 comments · Fixed by #1459
Closed
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@zarkone
Copy link

zarkone commented Sep 30, 2020

Problem description

i’ve tried to install ingress-controller using helm.v3.Chart and it failed: it turns out it was because admission createSecret job didn’t start, -- resource was not created by Pulumi. I’ve tried to install it with helm CLI and it went fine, — “admission createSecret” job appeared and completed

I’ve cloned those charts and played around with it locally — if I remove "helm.sh/hook": pre-install,pre-upgrade from metadata/annotations in Job template than Pulumi creates the Job. It looks like those hooks are not supported properly: I got this problem while doing clean install.

After short exploration of Pulumi code i've found that helm template command is used to render YAML. However, invocation of helm template from CLI gives me valid YAML with jobs, i.e. if I apply it from Pulumi -- it does create those Jobs and other missing resources -- which is actually my workaround for this situation.

Errors & Logs

Affected product version(s)

pulumi nodejs

    "@pulumi/kubernetes": "2.6.1",
    "@pulumi/pulumi": "2.10.2",

Reproducing the issue

const nginxController = new k8s.helm.v3.Chart("nginx-ctrl", {
  version: "3.3.0",
  chart: "ingress-nginx",
  fetchOpts: {
    repo: "https://kubernetes.github.io/ingress-nginx"
  },
  values: {
    controller: {
      service: {
        annotations: {
          "external-dns.alpha.kubernetes.io/hostname": "mydomain.net"
        },
        externalTrafficPolicy: 'Local',
      },
      config: {
        "use-forwarded-headers": 'true'
      }
    }
  }
});
@Place1
Copy link

Place1 commented Oct 26, 2020

I've hit this issue attempting to deploy the minio chart which creates Jobs as a post-install,post-upgrade hook: https://github.com/minio/charts/blob/master/minio/templates/post-install-create-bucket-job.yaml

If I clone the chart and just run a helm template . then I can see the jobs as expected.

@zarkone
Copy link
Author

zarkone commented Oct 27, 2020

@Place1 here's my quick workaround, just in case: https://gist.github.com/zarkone/d1868aa59a9ea2cec3c86982c0e42307.
I think also Helm v2 should work fine (as another workaround).

@Bazze
Copy link

Bazze commented Oct 30, 2020

We've encountered the same bug. We verified using the yaml render provider that many resources of the ingress-nginx helm chart were never rendered by Pulumi.

However, we found a workaround: use the same chart but with helm version 2 instead (k8s.helm.v2.Chart) of version 3. Worth a try for anyone encountering the same bug!

@knvpk
Copy link

knvpk commented Nov 1, 2020

Yes, Jobs are missing when using Chart v3 in pulumi, but it is working when using helm command line helm template

Yes, using v2 solves for,

But previously i thought v2 is for helm v2 (which requires tiller) thats why i avoided it first.

@knvpk
Copy link

knvpk commented Nov 2, 2020

But helm v2 is deprecated as of #1344

@knvpk
Copy link

knvpk commented Nov 2, 2020

Also using v2 crds will not install, does anybody have another alternative?

@lukehoban
Copy link
Member

I believe this is tracked also in #555.

@leezen leezen added this to the 0.52 milestone Feb 3, 2021
@lblackstone lblackstone added the kind/bug Some behavior is incorrect or out of spec label Feb 3, 2021
@lblackstone
Copy link
Member

Sorry for the delayed response here. I found the issue and have a fix in the linked PR, which should be included in this week's release.

@Jean-Baptiste-Lasselle
Copy link

Sorry for the delayed response here. I found the issue and have a fix in the linked PR, which should be included in this week's release.

Thank you so much for your PR @lblackstone , I am indeed myself facing the same issue in nginx helm chart and its admission webhooks. I amvery much expecting the pulumi release which will include your PR

@Jean-Baptiste-Lasselle
Copy link

oh gosh, @lblackstone my issue with NGINX admission webhooks is solved by upgrading to @pulumi/kubernetes 2.8.0 so much thankkkk youuu :D :) !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants