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

Allow setting the BGP graceful restart deferral time. See RFC4724 4.1 #753

Merged
merged 1 commit into from
Aug 22, 2019

Conversation

Cytrian
Copy link
Contributor

@Cytrian Cytrian commented Jul 3, 2019

GoBGP default value for deferral time is 360 seconds. That means that the
routes are not sent to the BGP peer until this timer is elapsed.

We painfully noticed this when we restarted kube-router in our cluster. The pod routes were first stale on the routers. After they expired it took some more minutes until they were updated again. The pods and services on the node were not reachable during this time. We also were hit hard by #725, which caused regular kube-router restarts.

@wu0407 wu0407 mentioned this pull request Jul 4, 2019
@bhcleek
Copy link
Contributor

bhcleek commented Aug 8, 2019

I can confirm that this is a problem that has affected us, too. I've tested this PR in our cluster, and it works as expected.

IMO, this PR is essential in order to be able to use the RollingUpdate strategy for the daemonset.

@bengadbois
Copy link

@andrewsykim do you mind taking a look at this one?

@@ -130,6 +131,8 @@ func (s *KubeRouterConfig) AddFlags(fs *pflag.FlagSet) {
"Each node in the cluster will setup BGP peering with rest of the nodes.")
fs.BoolVar(&s.BGPGracefulRestart, "bgp-graceful-restart", false,
"Enables the BGP Graceful Restart capability so that routes are preserved on unexpected restarts")
fs.Uint16Var(&s.BGPGracefulRestartDeferralTime, "bgp-graceful-restart-deferral-time", 10,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should probably be a DurationVar and we should convert it to uint16 later?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or at least mention "in seconds" in the CLI help string

@@ -105,9 +105,11 @@ func (nrc *NetworkRoutingController) syncInternalPeers() {
n.GracefulRestart = config.GracefulRestart{
Config: config.GracefulRestartConfig{
Enabled: true,
DeferralTime: nrc.bgpGracefulRestartDeferralTime,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is in seconds I'm guessing? Doesn't seem like gobgp documents this either.

@bhcleek
Copy link
Contributor

bhcleek commented Aug 20, 2019

@Cytrian this change is important to me, and I'm willing to complete the changes that @andrewsykim has requested if you're busy or no longer interested. Can you please let us know whether you'd prefer that someone else pick up the work in your stead?

@Cytrian
Copy link
Contributor Author

Cytrian commented Aug 20, 2019

I'll do it, it's not too difficult.

@andrewsykim
Copy link
Collaborator

andrewsykim commented Aug 20, 2019

PR looks good, please squash commits into meaningful messages (the first one looks good)

IPTablesSyncPeriod: 5 * time.Minute,
IpvsGracefulPeriod: 30 * time.Second,
RoutesSyncPeriod: 5 * time.Minute,
BGPGracefulRestartDeferralTime: 360 * time.Second,
Copy link
Collaborator

Choose a reason for hiding this comment

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

How was this default decided?

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, it's the gobgp default, so is fully backward compatible with prior kube-router releases.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, good to know thanks!

GoBGP's default value for deferral time is 360 seconds.
That means that the routes are not sent to the BGP peer until
this timer is elapsed, so a server is unreachable for 360
seconds, when kube-router restarts.

The new parameter is --bgp-graceful-restart-deferral-time duration_with_unit

For example '--bgp-graceful-restart-deferral-time 10s'
@andrewsykim
Copy link
Collaborator

Thanks! cc @murali-reddy @jimmy-zh

@andrewsykim andrewsykim merged commit 803bd90 into cloudnativelabs:master Aug 22, 2019
ticpu pushed a commit to ticpu/kube-router that referenced this pull request Dec 10, 2019
…cloudnativelabs#753)

GoBGP's default value for deferral time is 360 seconds.
That means that the routes are not sent to the BGP peer until
this timer is elapsed, so a server is unreachable for 360
seconds, when kube-router restarts.

The new parameter is --bgp-graceful-restart-deferral-time duration_with_unit

For example '--bgp-graceful-restart-deferral-time 10s'
mk01 pushed a commit to mk01/kube-router-ipv6 that referenced this pull request Mar 12, 2020
…cloudnativelabs#753)

GoBGP's default value for deferral time is 360 seconds.
That means that the routes are not sent to the BGP peer until
this timer is elapsed, so a server is unreachable for 360
seconds, when kube-router restarts.

The new parameter is --bgp-graceful-restart-deferral-time duration_with_unit

For example '--bgp-graceful-restart-deferral-time 10s'

(cherry picked from commit 803bd90)
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