forked from ovn-org/ovn-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete stale masquerade subnet resources if subnet gets changed at day 2
This PR does following: - Removes following linux resources if masquerade subnet gets changed (node side): * Removes old V4HostMasqueradeIP and V6HostMasqueradeIP from bridge. * Removes stale neighbour entries V4OVNMasqueradeIP, V6OVNMasqueradeIP, V4DummyNextHopMasqueradeIP and V6DummyNextHopMasqueradeIP if exists. * Removes stale masquerade route added by addMasqueradeRoute() function while starting up the gateway. * Removes stale iptables rules created for masquerade subnet based on ipForwarding and Gateway mode. - Removes following linux resources if masquerade subnet gets changed (ovnkube-controller to NBDB side): * Removes logical router static route used by gateway router and referencing old masquerade subnet. * Removes static mac binding for gateway router's rtoe logical port referencing old masquerade subnet. Note, the node now sets an annotation to indicate its masquerade subnet that it last configured. The node uses this at start up to determine if there has been a change and cleanup is needed. On the ovnkube-controller side, it also uses this annotation to determine if the node has changed. However, it may be racy to rely on this as the node thread may have already updated the annotation by the time the ovnkube-controller side handles the cleanup. Therefore, in addition to the annotation ovnkube-controller will additionally scan for stale routes in NBDB and then derive the route and mac binding to remove that way. In order to facilitate this, the masquerade route now has an external_id present (same as the key used in the annotation) to distinguish which routes are masquerade routes. Failure to delete things is not usually an overall failure for OVNK. Therefore upon failing to clean something up, the error is logged, but startup continues. Finally, kind.sh is updated to use a larger masquerade subnet by default. OVN-Kubernetes defaults themselves remain unchanged. Helm has also been updated to use a larger subnet. Co-authored-by: Tim Rozet <trozet@redhat.com> Signed-off-by: Arnab Ghosh <arnabghosh89@gmail.com>
- Loading branch information
Showing
22 changed files
with
836 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.