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

⚠️ Support global controller options in component config #1371

Conversation

vincepri
Copy link
Member

@vincepri vincepri commented Feb 5, 2021

This change adds support for our v1alpha1 ComponentConfig types to
expose configuration options for controllers. The only two current
exposed options are concurrency (done via a GroupKind map) and the cache
sync timeout option.

This is a breaking change, given that we're adding a new required method
to the Manager's interface.

Signed-off-by: Vince Prignano vincepri@vmware.com

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 5, 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 Feb 5, 2021
@vincepri
Copy link
Member Author

vincepri commented Feb 5, 2021

Need some feedback on this one :)

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 5, 2021
@christopherhein
Copy link
Member

/assign

Copy link
Member

@christopherhein christopherhein left a comment

Choose a reason for hiding this comment

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

This looks really good, couple of questions in the review but otherwise 👍

// Controller contains global configuration options for controllers
// registered within this manager.
// +optional
Controller *ControllerConfigurationSpec `json:"controller,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

In the description, you called this out as a breaking change but all the fields have optional? Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

The manager's interface new method addition is a breaking change

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see. For the most part the docs (at least the ones in Kubebuilder on master) point to embedding the core type so hopefully, anyone that has gone and implemented this would be able to receive the update to resolve this but for folks that aren't that makes sense. luckily we're still alpha 🎉

@@ -407,6 +416,14 @@ func (o Options) AndFrom(loader config.ControllerManagerConfiguration) (Options,
o.CertDir = newObj.Webhook.CertDir
}

if o.Controller.CacheSyncTimeout == nil && newObj.Controller.CacheSyncTimeout != nil {
Copy link
Member

Choose a reason for hiding this comment

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

should we check if o.Controller is nil first?

Copy link
Member Author

Choose a reason for hiding this comment

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

o.Controller is a non-pointer, to avoid checking it here

Copy link
Member

Choose a reason for hiding this comment

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

oh gotcha, confused with the exported controllerconfiguration. makes sense.

// ControllerConfigurationSpec defines the global configuration for
// controllers registered with the manager.
type ControllerConfigurationSpec struct {
// GroupKindConcurrency is a map from a Kind to the number of concurrent reconciliation
Copy link
Member

Choose a reason for hiding this comment

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

Love this idea, this will make it much easier to make per type configs.

@vincepri
Copy link
Member Author

vincepri commented Feb 5, 2021

/assign @alvaroaleman

for another set of 👀

This change adds support for our v1alpha1 ComponentConfig types to
expose configuration options for controllers. The only two current
exposed options are concurrency (done via a GroupKind map) and the cache
sync timeout option.

This is a breaking change, given that we're adding a new required method
to the Manager's interface.

Signed-off-by: Vince Prignano <vincepri@vmware.com>
@vincepri vincepri force-pushed the expose-controller-componentconfig branch from 6a4d296 to 82fc256 Compare February 5, 2021 20:04
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Feb 5, 2021

@vincepri: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-controller-runtime-apidiff-master 82fc256 link /test pull-controller-runtime-apidiff-master

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

Copy link
Member

@christopherhein christopherhein left a comment

Choose a reason for hiding this comment

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

/lgtm

👍 to this, nice work!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christopherhein, vincepri

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 52d5ec7 into kubernetes-sigs:master Feb 5, 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

4 participants