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

[PoC] Security Group Filtering #53

Closed
wants to merge 18 commits into from
Closed

[PoC] Security Group Filtering #53

wants to merge 18 commits into from

Conversation

Keyli0Iliev
Copy link

@Keyli0Iliev Keyli0Iliev commented Jan 13, 2023

Thank you for submitting a pull request to the bbs repository!

We appreciate the contribution. To help us understand the context for your pull request, please fill out this template to the best of your ability.

Please make sure to complete all of the following steps

  1. Check the Contributing document on how to sign the CLA and run tests.
  2. Submit your PR to this repo.
  3. Submit an accompanying PR Review Request referencing this PR so the Diego Team knows to review your pull request.

Please provide the following information:

What is this change about?

Adding Security group filtering to DesiredLRPFilter

What problem it is trying to solve?

In cases where there are a large amount of Security groups in a single space network traffic increases considerably as more apps are added to the space

What is the impact if the change is not made?

Sub-optimal component performance and indefinite increase in network load as customers add more apps to spaces.

How should this change be described in diego-release release notes?

Added security group filtering for DesiredLRPs when enabled bbs will not send security groups in the response

Please provide any contextual information.

Route emitter RP
Issue in Diego-release Issue link

Tag your pair, your PM, and/or team!

@PlamenDoychev

Thank you!

@Keyli0Iliev
Copy link
Author

[DoNotMerge]
[PoC]

Copy link
Member

@mariash mariash left a comment

Choose a reason for hiding this comment

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

Thank you, this is in general a very good idea to send less data over the wire. Please see my comments. I think it would be better to introduce new model and new api endpoint to get desired LRPs and that can even have less data. Let me know if this makes sense and if you have questions.

@@ -74,6 +74,9 @@ func (h *DesiredLRPHandler) commonDesiredLRPs(logger lager.Logger, targetVersion
if len(desiredLRPs[i].CachedDependencies) == 0 {
desiredLRPs[i].CachedDependencies = nil
}
if filter.SkipEgressRules {
desiredLRPs[i].EgressRules = nil
Copy link
Member

Choose a reason for hiding this comment

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

Nullifying the Egress Rules results in Desired LRP which is partially instantiated and doesn't represent the real object. Instead I think it is better to introduce new presenter model, e.g. DesiredLRPRouteInfo, that will only have information required by route-emitter.

@@ -65,7 +65,7 @@ func (h *DesiredLRPHandler) commonDesiredLRPs(logger lager.Logger, targetVersion

err = parseRequest(logger, req, request)
if err == nil {
filter := models.DesiredLRPFilter{Domain: request.Domain, ProcessGuids: request.ProcessGuids}
filter := models.DesiredLRPFilter{Domain: request.Domain, ProcessGuids: request.ProcessGuids, SkipEgressRules: request.SkipEgressRules,}
Copy link
Member

Choose a reason for hiding this comment

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

As mentioned below, I think it is better to introduce new model and new database call, that will only pull the required fields, instead of loading all of this into memory and then nullifying it.

ProcessGuids: filter.ProcessGuids,
Domain: filter.Domain,
ProcessGuids: filter.ProcessGuids,
SkipEgressRules: filter.SkipEgressRules,
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 introduce a new endpoint that only gets desired LRP routes information. Because this is not really a filter to select desired LRPs, the SkipEgressRules is a command we want to perform to present the data.

@MarcPaquette
Copy link
Contributor

Hi @Keyli0Iliev,

Have you had a chance to review @mariash's feedback? Is there any further work for this PR?

Thanks,
@MarcPaquette

@PlamenDoychev
Copy link

Hi @MarcPaquette,

We already reach-out to a conclusion and the filtering is implemented as part of another PR. I shall ask @Keyli0Iliev to close this PR as it is no longer relevant.

Regards,
Plamen Doychev

@Keyli0Iliev
Copy link
Author

Closing PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants