You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Helm detects wrong state when chart contains envFrom #2257
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.
Reacted by Homero Valle, Till Backhaus, Robert Sanders, Ryan Hartje and Andrew Cutler
The resource type is a deployment. The process was
install with envFrom (TRUE SUCCESS)
upgrade to a release with an arbitrary change (FAILED)
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.
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. ;)
changed the title [-]Helm detects wrong state when chart conatins envFrom[/-][+]Helm detects wrong state when chart contains envFrom[/+]on Apr 26, 2017
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.
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.
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.
Activity
technosophos commentedon Apr 11, 2017
So your process was:
envFromenvFrom(FAILED)env from(FALSE SUCCESS)What resource type were you adding
envFromto? And was it running after the second upgrade?jwkohnen commentedon Apr 12, 2017
The resource type is a deployment. The process was
envFrom(TRUE 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.
technosophos commentedon Apr 12, 2017
Yeah, I think it must be that the second kube diff operation does not generate anything. /cc @adamreese
hvalle commentedon Apr 18, 2017
Is there a workaround for this other than not using envFrom?
jwkohnen commentedon Apr 19, 2017
The only workaround I know is to
helm deletethe chart and thenhelm upgrade --installit again. If that's not an option for you (e.g. rolling update), I guess you'll have to abstain fromenvFromsince 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. ;)
kuroneko25 commentedon Apr 25, 2017
We are running into a similar problem with DaemonSet and setting
IMO this is a pretty serious bug and should be looked at soonish
[-]Helm confuses its state when chart has EnvFrom[/-][+]Helm detects wrong state when chart conatins envFrom[/+]jwkohnen commentedon Apr 26, 2017
Please change the label. @technosophos @adamreese
[-]Helm detects wrong state when chart conatins envFrom[/-][+]Helm detects wrong state when chart contains envFrom[/+]adamreese commentedon May 18, 2017
@wjkohnen what version of helm are you using? 1.6 features are supported in helm v2.4
technosophos commentedon May 18, 2017
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.
macropin commentedon Oct 4, 2017
@technosophos can we please have this labeled as a bug
redbaron commentedon Oct 4, 2017
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.
bacongobbler commentedon Oct 4, 2017
@redbaron, please be nice.
I assume this is the key point in the discussion here that is blocking it from happening:
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!
bacongobbler commentedon Oct 31, 2017
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.
For anything else, please open a new issue so we can track that discussion separately. Thanks.