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

Advertisement accept policies #181

Merged
merged 4 commits into from Aug 28, 2020
Merged

Advertisement accept policies #181

merged 4 commits into from Aug 28, 2020

Conversation

fraborg
Copy link
Member

@fraborg fraborg commented Aug 20, 2020

Description

This PR modifies the ClusterConfig CRD to define a policy for the acceptance of Advertisements.
The AdvertisementConfig has been split into 2 main fields:

  • OutgoingConfig (related to the broadcaster)
ResourceSharingPercentage int32
EnableBroadcaster         bool
  • IngoingConfig (related to adv operator)
MaxAcceptableAdvertisement int32
AcceptPolicy AcceptPolicy

AcceptPolicy is an enum which can have the following values

  • AutoAcceptWithinMaximum means all the Advertisement received will be accepted until the MaxAcceptableAdvertisement limit is reached
  • ManualAccept means every Advertisement received will need a manual accept/refuse, which can be done by updating its status (this is not implemented yet)

AutoAcceptAll can be achieved by setting MaxAcceptableAdvertisement to infinite
AutoRefuseAll can be achieved by setting MaxAcceptableAdvertisement to 0
Further policies can be easily added

The general approach towards config updates has changed too:

  • old approach : if newMax < oldMax, delete some advertisements until the newMax is respected
  • new approach : "apply the config from now on": advertisements already accepted are not deleted if the config changes

Other fixes

  • fixed adv operator and peering-request operator deployments in helm chart (the parameters for the broadcaster and virtual-kubelet images were missing)

How Has This Been Tested?

  • moved tests from test/controller.go to test/config-watcher.go adding Advertisement creation on a test cluster

@fraborg fraborg linked an issue Aug 20, 2020 that may be closed by this pull request
3 tasks
@fraborg fraborg changed the title Advertisement accept policies [WIP] Advertisement accept policies Aug 20, 2020
@fraborg fraborg marked this pull request as draft August 25, 2020 15:06
@fraborg fraborg force-pushed the frb/policy-update branch 4 times, most recently from 4355399 to 95b7845 Compare August 26, 2020 12:41
@fraborg fraborg marked this pull request as ready for review August 26, 2020 14:21
@fraborg fraborg changed the title [WIP] Advertisement accept policies Advertisement accept policies Aug 26, 2020
@palexster
Copy link
Member

palexster commented Aug 26, 2020

Fix. #176
Fix. #21

@fraborg fraborg force-pushed the frb/policy-update branch 2 times, most recently from 7d45e19 to d61f2f7 Compare August 27, 2020 07:23
@adamjensenbot adamjensenbot added the kind/docs Improvements or additions to documentation label Aug 27, 2020
@fraborg fraborg force-pushed the frb/policy-update branch 3 times, most recently from e7d633c to 86c3441 Compare August 28, 2020 08:53
Copy link
Member

@palexster palexster left a comment

Choose a reason for hiding this comment

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

/approve

@fraborg fraborg force-pushed the frb/policy-update branch 3 times, most recently from ca70582 to 816f1e5 Compare August 28, 2020 12:13
@fraborg fraborg requested a review from alacuku August 28, 2020 12:38
- AdvertisementConfig has been modified with 2 major fields, one for the broadcaster the other for the operator.
- in AdvOperatorConfig, the autoAccept flag is now an enum with different types of acceptance policies
The approach now is "apply the config from now on": advertisements already accepted are not deleted if the config changes
added documentation for Cluster configuration
missing parameter in adv operator and peering request operator
@mlavacca mlavacca merged commit 96854eb into master Aug 28, 2020
@mlavacca mlavacca deleted the frb/policy-update branch August 28, 2020 13:56

const (
// AutoAcceptWithinMaximum means all the Advertisement received will be accepted until the MaxAcceptableAdvertisement limit is reached
// AutoAcceptAll can be achieved by setting MaxAcceptableAdvertisement to infinite
Copy link
Member

Choose a reason for hiding this comment

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

@fraborg Sorry for coming so late but... what's the value for "infinite" here?

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 maximum value of int32 is 2147483647, but we can set the MaxAcceptableAdvertisement range from 0 to a value we decide, which can be our "infinite"

Copy link
Member

Choose a reason for hiding this comment

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

I would write this in the code (or, better, the definition of the structure), so that users know what they can configure.
Btw, not sure if we're telling users if this number refers to the max number of contemporary advertisements accepted, or the total number over time. Just in case, make sure this is clearly explained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/docs Improvements or additions to documentation size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] In-going Advertisement Policing
5 participants