helmfile: helmfile apply does not install crds folder

When using apply to install a helm 3 style chart with crds folder we get an error that the kind does not yet exist. Directly installing with sync does work however.

Shouldn’t helmfile get a list of installed releases so it knows to use sync upon first install?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 19 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@Morriz This comes from the fundamental issue on how K8s validates resources. As a workaround, I’ve added disableValidation: true which should be set for charts like prometheus-operator that tries to install CRDs and CRs on first install. See #1373

Re: idempotency, Helm 3 does support idempotency. You can verify that by e.g. seeing helmfile sync and helm upgrade --install just work against a chart like promethues-operator. It’s Helmfile + helm-diff’s problem. disableValidation: true is one of the solutions to it.

Another, potential solution would be to enable Helmfile to prevent showing diff on first install as you’ve suggested. But it shall be a breaking change. I think this specific issue can be addressed by disableValidation so shall we defer the first-install handling to another issue?

@Morriz Perhaps we can just enhance Helmfile to automatically set --disable-openapi-validation to helm-diff only when the target release is not yet installed? So that helm-diff called by helmfile would never fail due to missing CRD on first install.

Related https://github.com/databus23/helm-diff/pull/228

Basically, it’s a bit more elegant version of if helm list | grep your-crds-release; then helmfile apply; else helmfile sync.

@reixd I hear you. Do you think https://github.com/roboll/helmfile/issues/1353#issuecomment-726533131 would resolve your issue?

I am re-reading this again, and am concerned this will happen again soon: CRDs don’t get deployed, even though helm 3 supports deploying both CRDs and CRs at the same time.

we would like to be able to add repeatable, indempotent instructions to apply a chart to a cluster, so I would like to ask if helmfile might have solved this problem already in the mean time?

@mumoshu thanks again for your help!

Also, only the output would be different, but the resulting state is the same, so no breaking change imo. Who would use the text output of apply as input for anything? It’s just feedback for humans