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 flag for setting number of service account workers #69937

Conversation

andybradshaw
Copy link

What this PR does / why we need it: This PR makes the number of workers for the Service Account controller configurable. We are running into some issues with this controller keeping up, and needed a way of updating the currently hard-coded worker value of 1.

Special notes for your reviewer: The documentation for the --concurrent-serviceaccount-token-syncs flag seems to indicate that it defaults to 5, but was unable to find anything that handled the default values for the SAControllerConfiguration struct. Please let me know if defaults for that struct are handled in a different way.

Release note:

Added a configuration flag to controller-manager for number of service account sync workers.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 17, 2018
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 17, 2018
@andybradshaw
Copy link
Author

I believe I've associated my github account to my CNCF now... let me know if something still needs to be done there

@andybradshaw
Copy link
Author

/check-cla

@andybradshaw
Copy link
Author

/check-cla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 17, 2018
@idealhack
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 18, 2018
@fedebongio
Copy link
Contributor

/assign @cheftako

@@ -239,6 +239,15 @@ func SetDefaults_ResourceQuotaControllerConfiguration(obj *kubectrlmgrconfigv1al
}
}

func SetDefaults_SAControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.SAControllerConfiguration) {
if obj.ConcurrentSATokenSyncs == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

It seems this is already being set in SetDefaults_KubeControllerManagerConfiguration above.While the defaults seem to be the same do we want to allow for competing defaults?

Copy link
Author

Choose a reason for hiding this comment

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

Ah, sorry... missed that. It probably makes more sense to set it with the service account controller specific default function.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 23, 2018
Copy link
Member

@cheftako cheftako left a comment

Choose a reason for hiding this comment

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

/lgtm

@andybradshaw
Copy link
Author

@cheftako anything more I need to do here? Wasn't sure if I needed to address the needs-kind label.

@cheftako
Copy link
Member

/kind feature

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 26, 2018
@cheftako
Copy link
Member

@andybradshaw At this point you need an approver. I would check the OWNERS files detailed above.

@@ -426,6 +426,9 @@ type SAControllerConfiguration struct {
// serviceAccountKeyFile is the filename containing a PEM-encoded private RSA key
// used to sign service account tokens.
ServiceAccountKeyFile string
// concurrentServiceAccountSyncs is the number of service account syncing operations
// that will be done concurrently.
ConcurrentServiceAccountSyncs int32
Copy link
Member

Choose a reason for hiding this comment

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

@liggitt Ugh, do we do names wrong (as it's done here) in literally every config type?

Copy link
Member

Choose a reason for hiding this comment

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

do you mean not having json tags? this component doesn't yet read config from file, so we are free to rename fields, move them around, etc, prior to adding json tags.

that's on the roadmap to getting the components using external versioned config

Copy link
Member

Choose a reason for hiding this comment

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

This is showing up as an API violation. I'd like to not let anything in that adds to the violation file. Reasonable or excessive request?

Copy link
Member

@liggitt liggitt Nov 1, 2018

Choose a reason for hiding this comment

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

that requires adding json tags to the file prior to actually thinking through what the serialized names should be. we didn't want to do that. a file with no json tags is clearly not intended to be serialized yet. a mix of fields, some with tags and some without, looks like a serializable struct with mistakes.

Copy link
Member

Choose a reason for hiding this comment

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

a reasonable requirement would be to have no violations on the types prior to supporting loading these config types from files

Copy link
Member

Choose a reason for hiding this comment

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

The tool is complaining that concurrentServiceAccountSyncs != ConcurrentServiceAccountSyncs; if the json tag were added, the tool would be happy. I honestly think the tool is kind of right.

Copy link
Member

Choose a reason for hiding this comment

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

understood, but we did not want to add json tags before we intended the types to be serialized to files, because it implies they are serializable.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that makes sense. It seems the choices are to somehow exclude these types from the tool (which must currently believe they are serializable) or make the comment match the variable name. I don't care which choice is made, I think.

@andybradshaw andybradshaw force-pushed the ab/add-service-account-worker-configuration branch from 7aec01a to 77ca61d Compare November 1, 2018 21:59
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 1, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: andybradshaw
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: lavalamp

If they are not already assigned, you can assign the PR to them by writing /assign @lavalamp in a comment when ready.

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

@andybradshaw
Copy link
Author

@lavalamp @liggitt Happy working on whatever you guys decide on for the path forward here. That being said, I'm not sure what that is at the moment...

  1. I'm not sure making the comment name and the struct name match will fix the error, the linter is complaining about fields which are missing the json tag. Note the somewhat confusing example, which is meant to show that using a tag of json:"" will satisfy this rule. However, I do find the naming inconsistency annoying ( Update controller manager configuration field comments for consistency #70565).
  2. Making the tool skip these types might get a little wonky because of how coupled generation and validation are... If we split those up, maybe adding a tag (k8s:openapi-gen-lint=false?) to skip the structs, either individually or at the package level, would work.
  3. Would adding a placeholder tag of - be enough to indicate to consumers that attempting to do serialization stuff probably isn't going to do what you want? The presence of a tag, even if the field is ignored, could be confusing.

@lavalamp
Copy link
Member

lavalamp commented Nov 2, 2018 via email

@andybradshaw
Copy link
Author

I don't really have a notion of who owns what, so I'm going to keep @'ing people... let me know if I should stop.

@liggitt would the proposed change (json tag of -) be acceptable to you?

@lavalamp are we holding that change as blocking this one?

@lavalamp
Copy link
Member

lavalamp commented Nov 2, 2018

I want to take a pretty hard line about not adding violations starting asap; I'm willing to let this one in as long as we (i.e. @liggitt) all agree that the next change has to fix this.

@liggitt
Copy link
Member

liggitt commented Nov 2, 2018

@liggitt would the proposed change (json tag of -) be acceptable to you?

sure, that's fine as well

@andybradshaw
Copy link
Author

@liggitt okay, I can make that change as part of the comment clean up PR or a separate PR if that would be preferable

@lavalamp
Copy link
Member

lavalamp commented Nov 2, 2018 via email

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 18, 2019
@k8s-ci-robot
Copy link
Contributor

@andybradshaw: PR needs rebase.

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.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 18, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 18, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants