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

Create new Source Based Routing plugin #212

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

plwhite
Copy link
Contributor

@plwhite plwhite commented Oct 10, 2018

This creates a new plugin (sbr) which sets up source based routing, for use
as a chained plugin for multi-network environments.

Note to maintainers - this is now updated with tests etc. so should be ready to merge. I think I have addressed all comments so far.

plugins/meta/sbr/README.md Outdated Show resolved Hide resolved
Copy link
Member

@matthewdupre matthewdupre left a comment

Choose a reason for hiding this comment

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

Couple of rogue binary files in here which need un-adding. Will review the rest later (seems you can't comment on binary files?!).

@plwhite
Copy link
Contributor Author

plwhite commented Oct 11, 2018

I have updated the description to reflect tidy up behaviour, and removed the rogue binaries.

Code is still pending tests, and adding of deletion tidy up (I'm going to restructure slightly to make tidy up easier, so doubly not worth detailed code review yet, though I think the README description is correct).

plugins/meta/sbr/main.go Outdated Show resolved Hide resolved
plugins/meta/sbr/main.go Outdated Show resolved Hide resolved
plugins/meta/sbr/main.go Outdated Show resolved Hide resolved
@plwhite plwhite changed the title [WIP] Create new Source Based Routing plugin Create new Source Based Routing plugin Nov 20, 2018
@plwhite
Copy link
Contributor Author

plwhite commented Nov 20, 2018

I think this is now a decent candidate for a merge. I should squash commits before doing so, but deliberately haven't done that yet so you can see what's new.

{ "type": "flannel" },
{
"type": "sbr",
"logfile": "/var/log/sbr.log"
Copy link
Member

Choose a reason for hiding this comment

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

Generally, plugins just log to stderr.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, but I'd like to appeal on this one. By default the plugin just logs to stderr, but can be configured to log to file. I actually found the option of setting that debug option was very useful when testing.

Hence I can remove the logging to file if you want, but it felt like a good thing to have available when I needed it. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

@plwhite we don't have any general objection to logging elsewhere than stderr, but we believe plugins should always log to stderr. Any other logging should be additional to stderr. But we also want to figure out a "standard" way to tell plugins what level to log at and what the additional method to use, since we don't think that should be different for every plugin.

(eg, you would just want to tell Kubernetes or CRIO or Mesos to "turn on CNI debugging" and it would work for all plugins in a chain)

Copy link
Member

Choose a reason for hiding this comment

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

@plwhite so for now, if it's OK, we'd like to remove the logging and add it back later when we have a better plan for logging in general.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having thought this over, I agree that every plugin logging in its own way is insane, and strictly it's way more sensible that K8s should be trapping stderr and saving it somewhere.
So fair enough, I have removed it in my latest commit.

@plwhite
Copy link
Contributor Author

plwhite commented Jan 10, 2019

@dcbw Do you reckon this is ready for merge? It obviously needs commits squashed down to one, but I won't do that until we are ready.

@dcbw
Copy link
Member

dcbw commented Jan 16, 2019

@plwhite could you 'git rm plugins/meta/sbr/cnitest-c18c58aa-d341-2759-1fcd-2bbc1d1f2d01' and update? looks like that leftover test output snuck in or something.

Copy link
Member

@matthewdupre matthewdupre left a comment

Choose a reason for hiding this comment

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

plugins/meta/sbr/README.md Outdated Show resolved Hide resolved
plugins/meta/sbr/main.go Outdated Show resolved Hide resolved
@plwhite
Copy link
Contributor Author

plwhite commented Jan 17, 2019

I think I fixed everything required - happy to squash all the commits ready for merge now if you reckon it's ready to go?

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

LGTM pending squash of commits.
I'm interested to see what feedback comes from users, if any, about the logging.

@squeed
Copy link
Member

squeed commented Jan 23, 2019

Seems good to me. If later users file an issue asking for logging to be a bit less chatty, I would agree with them - but not enough to stop this PR now.

LGTM pending squash.

This creates a new plugin (sbr) which sets up source based routing, for use
as a chained plugin for multi-network environments.
@plwhite
Copy link
Contributor Author

plwhite commented Jan 31, 2019

I've squashed commits, ready for merge.

@dcbw dcbw merged commit 1865a07 into containernetworking:master Feb 6, 2019
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.

None yet

5 participants