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

improvement(helm): use --wait when deploying #6078

Merged
merged 1 commit into from
May 27, 2024
Merged

improvement(helm): use --wait when deploying #6078

merged 1 commit into from
May 27, 2024

Conversation

thsig
Copy link
Collaborator

@thsig thsig commented May 27, 2024

What this PR does / why we need it:

The --wait option for helm deploy and helm upgrade is now applied by default for helm Deploys.

We had previously used waitForResources for this (since Helm's rollout statuses weren't reliable enough when using --wait).

In the helm deploy handler, we now only use waitForResources to wait for resources updated for local or sync mode.

Which issue(s) this PR fixes:

Fixes #6053.

The `--wait` option for `helm deploy` and `helm upgrade` is now applied
by default for `helm` Deploys.

We had previously used `waitForResources` for this (since Helm's rollout
statuses weren't reliable enough when using `--wait`).

In the `helm` deploy handler, we now only use `waitForResources` to wait
for resources updated for local or sync mode.
@thsig thsig requested review from edvald and twelvemo May 27, 2024 09:26
Copy link
Collaborator

@twelvemo twelvemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@edvald edvald added this pull request to the merge queue May 27, 2024
Merged via the queue into main with commit 7a68373 May 27, 2024
40 checks passed
@edvald edvald deleted the helm-wait branch May 27, 2024 11:27
eysi09 pushed a commit that referenced this pull request Nov 12, 2024
Previously we would use Garden's own resource monitoring to monitor the
health of a Helm install/upgrade and fail fast if one of the resources
was unhealthy as well as show K8s events and Pod logs.

In commit 7a68373 we replaced that with Helm's own `--wait` flag.

The reason for that change was because a user reported issues with
Garden returning early from the Helm command in the success case
(see #6078 and #6053 for more details).

The problem with that change is that since we weren't using our own
resource monitoring we stopped showing events and logs when Helm
installs/upgrades fail. Another problem is that Garden would now wait
for the Helm command to complete which in the case of unhealthy
resources means Helm will timeout, with a default of 300 seconds.

This commit fixes that and we try to go for the best of both worlds:

- We always use the `--wait` flag but also monitor resources at the same time
- If the resources are healthy we wait for the Helm command to
  complete (this was the intent with 7a68373)
- If we detect unhealthy resources we fail fast (as we did before on the
  same major version)
- We add a flag to overwrite the fail fast behaviour in case a user
  might prefer that
eysi09 pushed a commit that referenced this pull request Nov 12, 2024
Previously we would use Garden's own resource monitoring to monitor the
health of a Helm install/upgrade and fail fast if one of the resources
was unhealthy as well as show K8s events and Pod logs.

In commit 7a68373 we replaced that with Helm's own `--wait` flag.

The reason for that change was because a user reported issues with
Garden returning early from the Helm command in the success case
(see #6078 and #6053 for more details).

The problem with that change is that since we weren't using our own
resource monitoring we stopped showing events and logs when Helm
installs/upgrades fail. Another problem is that Garden would now wait
for the Helm command to complete which in the case of unhealthy
resources means Helm will timeout, with a default of 300 seconds.

This commit fixes that and we try to go for the best of both worlds:

- We always use the `--wait` flag but also monitor resources at the same time
- If the resources are healthy we wait for the Helm command to
  complete (this was the intent with 7a68373)
- If we detect unhealthy resources we fail fast (as we did before on the
  same major version)
- We add a flag to overwrite the fail fast behaviour in case a user
  might prefer that
github-merge-queue bot pushed a commit that referenced this pull request Nov 14, 2024
fix(k8s): re-enable showing logs + failing fast on Helm errors

Previously we would use Garden's own resource monitoring to monitor the
health of a Helm install/upgrade and fail fast if one of the resources
was unhealthy as well as show K8s events and Pod logs.

In commit 7a68373 we replaced that with Helm's own `--wait` flag.

The reason for that change was because a user reported issues with
Garden returning early from the Helm command in the success case
(see #6078 and #6053 for more details).

The problem with that change is that since we weren't using our own
resource monitoring we stopped showing events and logs when Helm
installs/upgrades fail. Another problem is that Garden would now wait
for the Helm command to complete which in the case of unhealthy
resources means Helm will timeout, with a default of 300 seconds.

This commit fixes that and we try to go for the best of both worlds:

- We always use the `--wait` flag but also monitor resources at the same time
- If the resources are healthy we wait for the Helm command to
  complete (this was the intent with 7a68373)
- If we detect unhealthy resources we fail fast (as we did before on the
  same major version)
- We add a flag to overwrite the fail fast behaviour in case a user
  might prefer that

Co-authored-by: Eyþór Magnússon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Enable helm --wait flag
3 participants