Skip to content

Helm detects wrong state when chart contains envFrom #2257

Closed

Description

@jwkohnen

EnvFrom is a kubernetes v1.6 feature, but helm uses kubernetes v1.5 as dependency. When I try to update a release that uses EnvFrom, helm will fail with Error: UPGRADE FAILED: failed to create patch: unable to find api field in struct Container for the json field "envFrom" -- which is fine, given helm does not support this yet.

When I run the same upgrade command again, helm will copy a new state as ConfigMap in namespace kube-system and pretend the upgrade was successful. The actual state of the release does not change (upgrade), though.

Activity

  1. technosophos commented on Apr 11, 2017

    @technosophos
    Member

    So your process was:

    • install without envFrom
    • upgrade to a release with envFrom (FAILED)
    • upgrade again with env from (FALSE SUCCESS)

    What resource type were you adding envFrom to? And was it running after the second upgrade?

  2. jwkohnen commented on Apr 12, 2017

    @jwkohnen
    Author

    The resource type is a deployment. The process was

    1. install with envFrom (TRUE SUCCESS)
    2. upgrade to a release with an arbitrary change (FAILED)
    3. upgrade again w/o further change (FALSE SUCCESS)

    The deployment did not change its actual state since step 1.

    I assume the first install is a success because there is no attempt to diff. Our workaround is to delete and install the chart anyway due to the lacking feature. But the issue at hand is helm's lying about the actual state.

  3. technosophos commented on Apr 12, 2017

    @technosophos
    Member

    Yeah, I think it must be that the second kube diff operation does not generate anything. /cc @adamreese

  4. hvalle commented on Apr 18, 2017

    @hvalle

    Is there a workaround for this other than not using envFrom?

  5. jwkohnen commented on Apr 19, 2017

    @jwkohnen
    Author

    The only workaround I know is to helm delete the chart and then helm upgrade --install it again. If that's not an option for you (e.g. rolling update), I guess you'll have to abstain from envFrom since as of now helm creates an undefined state.

    Note that this issue is not about a lacking feature, but lacking robustness in face of an unknown feature. I.e. this is rather an important bug report, not a question/support ticket @technosophos. ;)

  6. kuroneko25 commented on Apr 25, 2017

    @kuroneko25

    We are running into a similar problem with DaemonSet and setting

    updateStrategy:
      type: RollingUpdate
    

    IMO this is a pretty serious bug and should be looked at soonish

  7. changed the title [-]Helm confuses its state when chart has EnvFrom[/-] [+]Helm detects wrong state when chart conatins envFrom[/+] on Apr 26, 2017
  8. jwkohnen commented on Apr 26, 2017

    @jwkohnen
    Author

    Please change the label. @technosophos @adamreese

  9. changed the title [-]Helm detects wrong state when chart conatins envFrom[/-] [+]Helm detects wrong state when chart contains envFrom[/+] on Apr 26, 2017
  10. adamreese commented on May 18, 2017

    @adamreese
    Member

    @wjkohnen what version of helm are you using? 1.6 features are supported in helm v2.4

  11. technosophos commented on May 18, 2017

    @technosophos
    Member

    There are really three problems that contributed to this bug.

    The particular problem with envFrom (rooted in Kubernetes changed schemas between 1.5 and 1.6) was resolved in Helm/Tiller >= 2.4.1. That alone is probably enough to close this particular issue.

    With Deployments and DaemonSets, there are added problems with the fields they silently treat as immutable. These are documented in the Kubernetes docs, but not schematized. There's not really much Helm can do about those. In those cases, schema validation passes, but Kubernetes ignores all "immutable" fields.

    Finally, there's the case where resource definitions get out of sync between Tiller and Kubernetes. That's a well-understood problem without an obvious solution. There has long been talk of fixing the Kubernetes apply logic, which we could then utilize. But in the near term we haven't devised an elegant solution.

    We need to decide on a single issue to treat as the definitive one for the out-of-sync problem, and then close the rest.

  12. macropin commented on Oct 4, 2017

    @macropin

    @technosophos can we please have this labeled as a bug

  13. redbaron commented on Oct 4, 2017

    @redbaron
    Contributor

    there's the case where resource definitions get out of sync between Tiller and Kubernetes. That's a well-understood problem without an obvious solution.

    I am sorry, but solution is also well understood and was mentioned multiple times: store SUCCESS/FAILURE states per individual resource, rather than whole manifest. then generate patches against last successful resource version, not last manifest irregardless of its version like it is happening now.

  14. bacongobbler commented on Oct 4, 2017

    @bacongobbler
    Member

    @redbaron, please be nice.

    I assume this is the key point in the discussion here that is blocking it from happening:

    There has long been talk of fixing the Kubernetes apply logic

    If this assumption is wrong and you have a patch that fixes it to save state from each individual resource, please feel free to contribute a fix!

  15. bacongobbler commented on Oct 31, 2017

    @bacongobbler
    Member

    I'm going to close this issue as helm uses the kubernetes 1.8 client libraries, so the issue OP mentioned was fixed a long time ago.

    The particular problem with envFrom (rooted in Kubernetes changed schemas between 1.5 and 1.6) was resolved in Helm/Tiller >= 2.4.1. That alone is probably enough to close this particular issue.

    For anything else, please open a new issue so we can track that discussion separately. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions