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

Add --concurrent-job-syncs flag to kube-controller-manager #117138

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

tosi3k
Copy link
Member

@tosi3k tosi3k commented Apr 6, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Number of job controller workers now defaults to 5 but cannot be overridden through CLI flags like one can already do for many other controllers in KCM.

Which issue(s) this PR fixes:

Fixes #80397.

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add '--concurrent-job-syncs' flag for kube-controller-manager to set the number of job controller workers

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. labels Apr 6, 2023
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.27 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.27.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Thu Apr 6 07:59:36 UTC 2023.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 6, 2023
@tosi3k tosi3k marked this pull request as draft April 6, 2023 10:26
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 6, 2023
@tosi3k tosi3k marked this pull request as ready for review April 6, 2023 10:27
@tosi3k
Copy link
Member Author

tosi3k commented Apr 6, 2023

/test pull-kubernetes-integration

@tosi3k tosi3k changed the title WIP add --concurrent-job-syncs flag to kube-controller-manager Add --concurrent-job-syncs flag to kube-controller-manager Apr 6, 2023
@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 6, 2023
@tosi3k
Copy link
Member Author

tosi3k commented Apr 6, 2023

/assign @wojtek-t

@wojtek-t
Copy link
Member

wojtek-t commented Apr 6, 2023

/assign @soltysh

I know there were some similar discussion about it recently (IIRC in the context of daemonset?)

@cici37
Copy link
Contributor

cici37 commented Apr 6, 2023

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 6, 2023
@cici37
Copy link
Contributor

cici37 commented Apr 6, 2023

/sig cli

@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Apr 6, 2023
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

This proposal is similar to #110433 and #111800 which both were closed. Especially the last comments in the latter propose increasing qps for controllers which would help in some scenarios, but there are still some issues holding us back. For now I'm going to close this as won't do it in the near term.

/close

@k8s-ci-robot
Copy link
Contributor

@soltysh: Closed this PR.

In response to this:

This proposal is similar to #110433 and #111800 which both were closed. Especially the last comments in the latter propose increasing qps for controllers which would help in some scenarios, but there are still some issues holding us back. For now I'm going to close this as won't do it in the near term.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mborsz
Copy link
Member

mborsz commented Apr 12, 2023

Thanks @soltysh for review!

The main difference between daemonsets (mentioned by you #111800) and jobs is that it is a valid use case to have a lot of tiny jobs (while daemonsets will usually be larger), so the problem is that even with the current qps controller limits there are use cases when we fail to saturate the job's controller qps limit due to insufficient concurrency (think of e.g. 1000 jobs, each with 1 pod to be created, if we have 5 workers, we would have max 5 concurrent pod creations).

With pod creation latency around 10ms (based on performance tests perf-dash, but technically p99 slo is 1s for such mutating calls), we will get ~50 qps which is far from client-side qps limit of 100 qps.

The reason for adding the flag by @tosi3k is to support such use cases.

I agree that adding such flag will require us to support it in the future, but it's actually hard to imagine an implementation where we won't have a concept of worker (which is now used by nearly all controllers in kube-controller-manager)

You mentioned that we need community support to prove value of the flag and I think we already have quite a lot of use cases:

Alternative approach would be to increase default worker count -- in most cases we should be throttled by qps anyway so no difference, cost of additional few goroutines is low, but in some corner cases the default value of 5 may not be sufficient and this is why people are asking for the flag.

@mborsz
Copy link
Member

mborsz commented Apr 12, 2023

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Apr 12, 2023
@k8s-ci-robot
Copy link
Contributor

@mborsz: Reopened this PR.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 12, 2023
@tosi3k
Copy link
Member Author

tosi3k commented Apr 12, 2023

Per offline discussion - fixed the description and added validation for the flag value.

@soltysh PTAL.

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Based on the provided reasoning behind this change, and based on an offline discussion
/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 12, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 0d882346c4427f2859ca312ef08ba639f031a840

@soltysh
Copy link
Contributor

soltysh commented Apr 12, 2023

/triage accepted
/priority important-longterm

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 12, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: soltysh, tosi3k

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 12, 2023
@k8s-ci-robot k8s-ci-robot merged commit 5d8c99a into kubernetes:master Apr 12, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone Apr 12, 2023
aojea pushed a commit to aojea/kubernetes that referenced this pull request Jun 14, 2023
Cherry-picks kubernetes#117138

Change-Id: I886457d8b14fee268078cdf45d469bb6712e721c
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow ConcurrentJobSyncs to be set for kube-controller-manager
6 participants