Commit graph

23 commits

Author SHA1 Message Date
Nathan Baulch
ff9dd262e3
Fix typos
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-14 10:29:56 +10:00
Matt Farina
c042264a9d
Fix issues when verify generation readiness was merged
CI, tests, and building failed after #10920 was merged. This change
fixes the issues that were introduced.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-01-08 22:40:28 -05:00
Matt Farina
b299359f66
Merge pull request #10920 from muang0/readiness-generation-check
Verify generation in readiness checks
2024-01-08 22:29:31 -05:00
Stefan McShane
1a3e9a95dd addressing comment
Signed-off-by: Stefan McShane <stefanmcshane@users.noreply.github.com>
2023-07-19 12:35:14 -04:00
Joe Julian
99e1dce8c8
Merge pull request #9950 from jeffrosenberg/error-on-failed-jobs-9285
Throw an error from jobReady() if the job exceeds its BackoffLimit
2023-07-13 08:21:58 -07:00
Joe Julian
dcd54d59e6
Merge branch 'main' into readiness-generation-check
Signed-off-by: Joe Julian <me@joejulian.name>
2023-05-10 16:48:22 -07:00
Aman Nijhawan
eea2f27bab
Fixes Readiness Check for statefulsets using partitioned rolling update. (#11774)
* Fixes Readiness Check for statefulsets using partitioned rolling update.
Fixes #11773

This change updates readiness check in ready.go to correctly
account for statefulsets that are utilizing a partitioned upgrade.
These statefulsets only upgrade a subset of the managed pods with each call
to helm upgrade. This causes the upgrade to legitimately hit the condition where
sts.status.CurrentRevision != sts.Status.UpdateRevision which causes helm to mark
the upgrade has failed when in fact it is successful.

This change fixes that behavior to only check when partition is unspecified or 0.

Signed-off-by: Aman Nijhawan <anijhawan@yugabyte.com>

* Adding a unit test to verify that partitioned rolling upgrade for a statefulset works.

Signed-off-by: Aman Nijhawan <anijhawan@yugabyte.com>

---------

Signed-off-by: Aman Nijhawan <anijhawan@yugabyte.com>
Co-authored-by: Aman Nijhawan <anijhawan@yugabyte.com>
2023-03-30 10:39:29 -06:00
muang0
141fa4a037
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:23:13 -05:00
muang0
4cb62d1262
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:22:58 -05:00
muang0
dbb21fcf44
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:22:35 -05:00
muang0
fcc03324a6
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:22:18 -05:00
muang0
a1a1aafb7d
Update pkg/kube/ready.go
more readable debug log fmt (i64)

Co-authored-by: Bjorn Svensson <bjorn.a.svensson@est.tech>
Signed-off-by: muang0 <joden1995@gmail.com>
2023-02-26 09:21:36 -05:00
Qifan Shen
9d59d92abb use intstr.GetScaledValueFromIntOrPercent instead of the deprecated
Signed-off-by: Qifan Shen <sqfphoenix@163.com>
2022-10-13 16:58:24 +08:00
James Oden
d008340891 ready checker- comment update
Signed-off-by: James Oden <james.oden.dev@gmail.com>
2022-08-31 22:01:24 -04:00
James Oden
4f99c86914 ready checker- remove duplicate statefulset generational check
Signed-off-by: James Oden <james.oden.dev@gmail.com>
2022-08-31 22:01:05 -04:00
James Oden
f067073e23 Merge branch 'main' into readiness-generation-check 2022-08-31 21:41:34 -04:00
Dominic Evans
7c74f1dd02 fix: improve logging & safety of statefulSetReady
Confirm that the current and updated revision numbers also match as part
of the readiness check. Add coverage for readiness scenarios where
StatefulSet status does not reflect the most recent generation of the
StatefulSet yet.

Also add additional logging around the sts transitions from non-ready to
ready.

Fixes: #10163

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
2022-06-28 09:48:17 +01:00
James Oden
d94c5094f6 Verify generation in readiness checks
Signed-off-by: James Oden <james.oden.dev@gmail.com>
2022-05-02 01:35:09 -04:00
Bhavin Gandhi
c3310bb724 fix(pkg/kube): statefulSetReady: handle partition cases correctly
The partition value can be greater than number of replicas, in that
case no pods are rolled out. The expectedReplicas becomes a negative
number.
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions

In the cases where the update does not change anything in the pod
template, the updatedReplicas value from StatefulSet status remains
unchanged. Such updates can still set some partition value, and
UpdatedReplicas is always greater than expectedReplicas. Basically,
the StatefulSet is ready / rolled-out.

In both the above scenarios, providing `--wait` flag causes it to
timeout waiting indefinitely. Because updatedReplicas can never be
negative, or be equal to the expectedReplicas for the second case.

This commit handles both the scenarios by checking if UpdatedReplicas
is smaller than expectedReplicas. If it is, then the StatefulSet is
not ready yet.

Based on the code from kubectl rollout:
a450ebd59c/pkg/polymorphichelpers/rollout_status.go (L138-L141)

Closes #8674

Signed-off-by: Bhavin Gandhi <bhavin7392@gmail.com>
2021-11-26 19:06:25 +05:30
Jeff Rosenberg
b13f3a13d4
Merge branch 'main' into error-on-failed-jobs-9285 2021-09-11 11:08:06 -05:00
lsowen
249d1b5fb9 Fix SIGSEGV when job.Spec.Completions is nil
Signed-off-by: lsowen <logan@s1network.com>
2021-08-22 13:32:27 -04:00
Rosenberg, Jeff
cd04e3f418 Throw an error from jobReady() if the job exceeds its BackoffLimit
Closes #9285

Signed-off-by: Rosenberg, Jeff <jeff.rosenberg@icfnext.com>
2021-07-16 16:15:57 -05:00
Joe Lanford
98d98369ed
Add ReadyChecker to decouple ready check logic from --wait
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
2021-03-29 11:52:33 -04:00