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

Implement watch-based daemonset replica counter. #1777

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

mborsz
Copy link
Member

@mborsz mborsz commented Mar 31, 2021

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

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 31, 2021
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 31, 2021
@mborsz mborsz force-pushed the da branch 4 times, most recently from f8bd996 to 9b3a7c4 Compare April 7, 2021 08:18

// ConstReplicas is a ReplicasWatcher implementation that returns a constant value.
type ConstReplicas struct {
Const int
Copy link
Member

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 :)

Copy link
Member Author

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 :)

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@mborsz mborsz changed the title [WIP] Implement watch-based daemonset replica counter. Implement watch-based daemonset replica counter. Apr 7, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 7, 2021
@mborsz
Copy link
Member Author

mborsz commented Apr 7, 2021

This is ready for review.

@wojtek-t
Copy link
Member

wojtek-t commented Apr 7, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 7, 2021
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit a397740 into kubernetes:master Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants