Repository navigation
Conversation
|
Thanks for submitting this patch @sorenmat |
|
I'm very concerned about this patch's behaviour, especially since it upgrades using the configuration from the latest failed release which was the exact reason why we introduced #3097 in the first place. It's just going to re-introduce those bugs in the same manner all over again. I'm sorry, but I don't think this is the right approach at all. |
|
ok, this was not my intention at all :) |
|
Yep. I mentioned the potential fix here: #3353 (comment) |
If the first `upgrade --install` results in a state FAILED, you can not run the same command `upgrade --install` again without a failure. This happens becuase we are search only for releases with the status DEPLOYED. This change will if the search for DEPLOYED fails, then try to search for a release with the state FAILED, and if found upgrade that. This fixes issue helm#3353
0755066 to
8527ebc
Compare
|
@bacongobbler I tired to change the PR to reflect your concerns, please let me know if it looks better now. |
|
@bacongobbler Pleaaaaaase review this. We have the same use case as @sorenmat - CI/CD. |
|
@Nowaker I don't believe this patch is in a ready state right now. |
|
@Nowaker could someone review it, so we can make it ready? |
|
We're kinda busy getting prepped for the dev summit next week, but I (or someone else) can take a look at this afterwards. :) |
|
Cool, I also forgot a please in my previous message 😕 |
|
@sorenmat Sure, do you have a binary at hand? |
|
@Nowaker you should be able to run with this |
|
@sorenmat I can confirm your Tiller works well and I'll keep using it until it's merged and released in Helm. 😹 Pleaaaase don't delete! Thanks! |
|
Can we merge it? |
|
would this also fix an upgrade that is stuck ("Error: UPGRADE FAILED: "release" has no deployed releases") even if there are succesful deployments? The history of the release shows previous revisions as status "SUPERSEDED" (at least the ones I can see with: helm history release --max=25, can't go further back due to some other error: "Error: grpc: received message larger than max"). Is "SUPERSEDED" not considered as succesful deployment? |
|
@Nowaker I wont :) |
| func TestStorageFailed(t *testing.T) { | ||
| storage := Init(driver.NewMemory()) | ||
|
|
||
| const name = "angry-bird" |
| } | ||
| } | ||
|
|
||
| func newInstallFailingKubClient() *installFailingKubeClient { |
There was a problem hiding this comment.
typo: newInstallFailingKub/e/Client
| return nil, nil, err | ||
| } | ||
| } else { | ||
| // try to find a failed release we can upgrade |
There was a problem hiding this comment.
I'm sorry, but as I mentioned before, we don't want to be upgrading from a failed deploy. We want to upgrade from a completely clean state, as if this was an initial release and there were no deploys released at all. Otherwise we're just reverting back to old behaviour prior to the old PR and we're back to square one.
Is there something I'm missing here perhaps, or am I right in my initial view that this is looking for a failed deploy to upgrade from?
There was a problem hiding this comment.
@bacongobbler There's a whole discussion thread about this. tl;dr upgrading from a failed state is a must-be for CI/CD environments - we need idempotent builds.
There was a problem hiding this comment.
@bacongobbler I guess you can look at the issue from another angle. When we are installing the first version of the chart and the fails, why do register it at all. If we removed all traces of that deploy then we wouldn't run into this issue.
On the other hand we are loosing the track record that somebody actually tried to deploy something that failed.
There was a problem hiding this comment.
@Nowaker and @sorenmat : as far as I undertand it in #3353 (comment) @bacongobbler suggested to not update from a failed release (which causes diffing with it and in turn various
other problems) but instead ignore the failed release(s) completely and treat the upgrade like a fresh install (meaning no diffing or reuse of old values). This would keep the release history intact and not require to delete a release manually that has only failed deployments.
Sorry for the interference but I have a feeling the input form @bacongobbler was overlooked and we are digging trenches for nothing.
There was a problem hiding this comment.
Oh, gotcha. I'm not an opponent or proponent of a particular implementation (I know nothing about Helm's internals). We just want a way to install/upgrade a chart, no matter what state it is now (if any).
|
Sorry to jump in late to this one... When a failure happens during a release it is unknown what artifacts were created. If the upgrade failed part way through creating resources and you diff against what [would] be in cluster some resources will not be created. One option would be to add a
|
|
@adamreese For a CI/CD system, we wouldn't want |
|
I can see that viewpoint. Unfortunately, we cannot accept this PR as-is due to the technical complications of upgrading from an unknown state, and after discussing with @adamreese in the dev call this morning, my earlier proposal won't work either because the release is now in an unknown state so we can't do a "vanilla" install. After the first release has failed, the cluster's state is now unknown, so we cannot install as if from a clean slate. As far as I understand the situation, there are only two proposals that will work to resolve this for the general case:
Do you have alternative proposals that might work for you? Perhaps elaborating on your use case (and any others who want to chime in) might be a good way to move this forward. |
|
Option 2 - "if this is a failed deployment, purge and then deploy" inside |
|
Okay. I'll work on an alternate PR with that feature in mind and close this one. Thanks @sorenmat! |
|
@bacongobbler |
|
And thanks @bacongobbler! |
|
sorry for coming back to this. I can see the --force option will solve the majority of issues. But I don't see how persistent volumes would be treated? Some resources should not be deleted and re-created. And the helm command line seems to have no options to investigate which kubernetes resources failed to deploy within a release. So I could try fixing just that issue and re-try to install that resource to have a successful release. (this use case isn't a problem when really the first release failed, but some tool support to investigate whats broken later on during the life of an installed chart would improve the ability to act when things don't work for whatever reason). Is there some more suitable place to discuss this other then this PR? |
|
Thanks for the reply! I saw that other PR. Highly welcome :) Alright! I'll dig around in the issues and see to create what I feel is missing. |
|
@wemu please do cc me on the persistent volumes issue, I am struggly with that too. There are to many unrecoverable points the the There is a StatefulSets PVCs don't get deleted by Right now I've come to the conclusion any stateful PVCs should be kept out of your helm charts, or I guess in a helm chart just for the PVC. For NFS mounts and similar you can just directly mount them in the chart, with no PVC, which we've been doing. I'd prefer to use PVC's with |
If the first
upgrade --installresults in a state FAILED, you can notrun the same command
upgrade --installagain without a failure.This happens becuase we are search only for releases with the status DEPLOYED.
This change will if the search for DEPLOYED fails, then try to search for a release
with the state FAILED, and if found upgrade that.
This fixes issue #3353