Skip to content

Conversation

pippolo84
Copy link
Member

@pippolo84 pippolo84 commented Apr 9, 2025

#38483 moved the insertions of Pod CIDRs from tunnel map to ipcache map. Therefore, tunnel map is not needed anymore and can be (almost entirely) removed.
In order to keep Cilium upgrade operations working correctly, we preserve the unpinning of the map at startup in the current version. Regarding downgrades, nothing more is needed, since tunnel map is recreated at startup in Cilium v1.17:

if option.Config.TunnelingEnabled() {
if err := tunnel.TunnelMap().Recreate(); err != nil {
return fmt.Errorf("initializing tunnel map: %w", err)
}

Note to reviewers: better reviewed commit by commit.

Since pod CIDRs are now stored into the ipcache map, tunnel map is not needed anymore. Any reference to the tunnel map have been removed from cilium-dbg, cilium status and bugtool.

Blocked on #38490

@pippolo84 pippolo84 added dont-merge/preview-only Only for preview or testing, don't merge it. dont-merge/blocked Another PR must be merged before this one. labels Apr 9, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Apr 9, 2025
@pippolo84 pippolo84 changed the title [REVIEW] Remove tunnel map [PREVIEW] Remove tunnel map Apr 9, 2025
@pippolo84 pippolo84 force-pushed the pr/pippolo84/remove-tunnel-map branch 3 times, most recently from 2ad52f9 to df0e61d Compare April 9, 2025 19:41
@pippolo84
Copy link
Member Author

/test

@pippolo84 pippolo84 force-pushed the pr/pippolo84/remove-tunnel-map branch from df0e61d to 890d2a0 Compare April 10, 2025 10:11
@pippolo84 pippolo84 added the release-note/minor This PR changes functionality that users may find relevant to operating Cilium. label Apr 10, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Apr 10, 2025
@pippolo84 pippolo84 added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. and removed dont-merge/preview-only Only for preview or testing, don't merge it. labels Apr 10, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Apr 10, 2025
@pippolo84 pippolo84 changed the title [PREVIEW] Remove tunnel map Remove tunnel map Apr 10, 2025
@pippolo84 pippolo84 force-pushed the pr/pippolo84/remove-tunnel-map branch from 890d2a0 to cd1c68f Compare April 10, 2025 10:20
@pippolo84
Copy link
Member Author

/test

@pippolo84 pippolo84 force-pushed the pr/pippolo84/remove-tunnel-map branch 2 times, most recently from 2b6a659 to 99f07fd Compare April 17, 2025 09:07
@pippolo84 pippolo84 added affects/v1.17 This issue affects v1.17 branch area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. cilium-cli This PR contains changes related with cilium-cli area/cli Impacts the command line interface of any command in the repository. labels Apr 17, 2025
@pippolo84 pippolo84 marked this pull request as ready for review April 17, 2025 09:08
@pippolo84 pippolo84 requested review from a team as code owners April 17, 2025 09:08
@pippolo84 pippolo84 requested review from thorn3r, YutaroHayakawa, rgo3, a user and derailed April 17, 2025 09:08
@pippolo84 pippolo84 removed the dont-merge/blocked Another PR must be merged before this one. label Apr 17, 2025
@pippolo84
Copy link
Member Author

/test

Copy link
Contributor

@derailed derailed left a comment

Choose a reason for hiding this comment

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

@pippolo84 Nice work!

Copy link
Member

@YutaroHayakawa YutaroHayakawa left a comment

Choose a reason for hiding this comment

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

Finally!

Copy link
Contributor

@thorn3r thorn3r left a comment

Choose a reason for hiding this comment

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

Nice work 👍

Copy link
Contributor

@rgo3 rgo3 left a comment

Choose a reason for hiding this comment

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

Loader changes LGTM, thanks Fabio!

Since pod CIDRs are now upserted into ipcache map, tunnel map is going
to be removed in a subsequent commit.  Therefore, remove the related
cilium-dbg commands. Moreover, fix the documentation removing and add
redirects to the `cilium-dbg bpf ipcache` commands.

Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Tunnel map will not be created anymore at startup, so no need to remove
it anymore after uninstall.

Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
As tunnel map has been deprecated in favor of the ipcache map.

Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
After deprecation of tunnel map in favor of the ipcache map, there is no
need to collect the map content when running bugtool.

Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Remove any tunnel map related code from both controlplane and datapath,
leaving only what is needed to unpin the map at startup. This is needed
to take care of tunnel map removal when upgrading Cilium from a previous
minor release.

Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Tunnel map has been deprecated in favor of the ipcache map. When
upgrading from a previous Cilium minor release, we want to ensure that
the tunnel map from the previous version is unpinned at startup, no
matter if we are now running in tunnel or native routing mode. Doing
that ensures that it is eventually removed after endpoints regeneration.

Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
@pippolo84 pippolo84 force-pushed the pr/pippolo84/remove-tunnel-map branch from 99f07fd to 2e61fb9 Compare April 22, 2025 14:07
@pippolo84
Copy link
Member Author

/test

Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

Approving for @cilium/docs-structure

@joestringer joestringer enabled auto-merge April 22, 2025 19:44
@joestringer joestringer removed the request for review from a user April 22, 2025 19:44
@pippolo84
Copy link
Member Author

ci-e2e-upgrade is hitting #38989, rerunning

@joestringer
Copy link
Member

ci-e2e-upgrade was experiencing the symptoms of #38989, but the actual failure for all three completed runs was #39034. That issue was a frequent cause of failures on main over the past week. We merged a fix for that today so it should be no longer applicable.

@joestringer joestringer disabled auto-merge April 22, 2025 23:09
@joestringer joestringer merged commit a76844e into cilium:main Apr 22, 2025
68 of 77 checks passed
Comment on lines +163 to +165
err := tunnel.TunnelMap().Unpin()
if err != nil && !errors.Is(err, fs.ErrNotExist) {
return fmt.Errorf("removing tunnel map: %w", err)
Copy link
Member

Choose a reason for hiding this comment

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

👋 @pippolo84 for my own education - did you opt against using UnpinIfExists() here for a specific reason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/v1.17 This issue affects v1.17 branch area/cli Impacts the command line interface of any command in the repository. area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. cilium-cli This PR contains changes related with cilium-cli release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants