-
Notifications
You must be signed in to change notification settings - Fork 517
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
Implement watch-based daemonset replica counter. #1777
Conversation
f8bd996
to
9b3a7c4
Compare
clusterloader2/pkg/measurement/util/runtimeobjects/replicaswatcher.go
Outdated
Show resolved
Hide resolved
|
||
// ConstReplicas is a ReplicasWatcher implementation that returns a constant value. | ||
type ConstReplicas struct { | ||
Const int |
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.
I think "Replicas int" would be more intuitive :)
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.
I tried that initially, but I got "field and method with the same name Replicas (see details)" compiler error :)
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.
Maybe ReplicasCount ?
Const is too ambiguous to me.
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.
Done
clusterloader2/pkg/measurement/util/runtimeobjects/replicaswatcher.go
Outdated
Show resolved
Hide resolved
clusterloader2/pkg/measurement/util/runtimeobjects/runtimeobjects_test.go
Show resolved
Hide resolved
This is ready for review. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mborsz, wojtek-t The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Problem: waitForControlledPodsRunning for daemonsets calculates a number of expected replicas based on the number of nodes that are schedule. That number can vary over time (e.g. node becoming notready/ready).
We are seeing a tests runs where e.g. node X was unhealthy for a short period of time for whatever reason (physical machine failure). During that time, we calculated a number of replicas. Then node becomes healthy and daemonset controller creates more replicas than we expect making the test fail.
This code introduces a watch for node objects to track accurate number of expected replicas over time