-
Notifications
You must be signed in to change notification settings - Fork 14
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
improve deployment status report #142
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #142 +/- ##
==========================================
- Coverage 86.06% 84.70% -1.36%
==========================================
Files 19 19
Lines 990 994 +4
==========================================
- Hits 852 842 -10
- Misses 91 98 +7
- Partials 47 54 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
if deployment.Status.ReadyReplicas != deployment.Status.Replicas { | ||
return ptr.To("Deployment has replicas not ready yet"), nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any thoughts about an edge case where an user sets limitador.spec.replicas
to 0
, so deployment.status.replicas
is 0
. The current logic will mark the CR status as Ready: true
, would this be the expected status for this edge case? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. I think we should follow the same approach as the replication controller for the Deployment object.
I set limtiador CR with replica: 0
spec:
replicas: 0
The operator updates the deployment object to:
spec:
replicas: 0
....
And the status of the deployment is:
status:
conditions:
- lastTransitionTime: "2024-06-10T08:26:11Z"
lastUpdateTime: "2024-06-10T08:26:11Z"
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
- lastTransitionTime: "2024-06-10T08:25:51Z"
lastUpdateTime: "2024-06-10T08:26:11Z"
message: ReplicaSet "limitador-limitador-76c6d7bd46" has successfully progressed.
reason: NewReplicaSetAvailable
status: "True"
type: Progressing
observedGeneration: 2
Note that as status.availableReplicas
, status.readyReplicas
, status.replicas
are all 0
, they are not shown in the response (considered "empty").
Yet, the status condition Available
is True
. Thus, we can account that as "available".
Thus, IMO, limitador CR status should also be considered "Ready". I agree, though, that "Ready" does not reflect the actual state. It would be more meaningful, "Reconciled" or "Stable" or something that means, limitador is what it should be, what the user wanted to be. When the replicas are 0
, I can leave "Ready" to "True", and the message would be "Limitador is ready, but without running instances". (or something like that).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, sounds good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified, looks good to me 👍
What
Fixes #140
After initial deployment, some changes in the limitador CR trigger pods rolling out to capture latest desired configuration. During that rolling out process, the deployment object's status condition
Available
remainstrue
.Deployment status object during steady state
Deployment status object during pods being rolled out
Few things change during rolling out. First and foremost,
unavailableReplicas
field is not0
. Additionally,readyReplicas
is not equal toreplicas
.This PR enhances controller status reporting capturing aforementioned new conditions to report limitador's state as
Ready
.Verification steps
dev setup
Deploy limitador with defaults.
Wait for limitador to be ready
Check status
It should report "Ready"
Let's update
verbosity
level to trigger pods rolling out. "Quickly", we need to check Limitador CR's status to verify that status reports not ready during rolling out. Eventually, status should report "Ready".Check status
During rolling out,
you should get
Deployment has unavailable replicas
. And eventually, back to Ready state.