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

Revert "Create xtables.lock as a file if it doesn't already exist" #2889

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

skitt
Copy link
Member

@skitt skitt commented Nov 14, 2023

This reverts commit 93f8d3a.

The xtables.lock mount was fixed to specify its type: it must exist as a file, or be created as a file.

xtables.lock is only used with legacy iptables. On platforms using iptables-nft, the file isn't used and doesn't exist. As a result, previous versions of Submariner created it as a directory (this is the default behaviour for volume mounts in Kubernetes: if the mount doesn't exist, it is created as a directory). When the volume mount type is specified as a file, the existence of a directory causes the mount to fail and the corresponding pod is never scheduled.

To avoid this, revert to the default behaviour. On systems where the lock is important, it already exists so the directory isn't created and the correct behaviour is guaranteed. On systems where the lock isn't needed, it is created as a directory but that doesn't matter.

Future releases of Submariner will have to deal with this correctly, and handle upgrades, ideally without mounting all of /run permanently.

@skitt skitt added the backport This change requires a backport to eligible release branches label Nov 14, 2023
@submariner-bot
Copy link
Contributor

🤖 Created branch: z_pr2889/skitt/revert-xtables-lock-mount
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

This reverts commit 93f8d3a.

The xtables.lock mount was fixed to specify its type: it must exist as
a file, or be created as a file.

xtables.lock is only used with legacy iptables. On platforms using
iptables-nft, the file isn't used and doesn't exist. As a result,
previous versions of Submariner created it as a directory (this is the
default behaviour for volume mounts in Kubernetes: if the mount
doesn't exist, it is created as a directory). When the volume mount
type is specified as a file, the existence of a directory causes the
mount to fail and the corresponding pod is never scheduled.

To avoid this, revert to the default behaviour. On systems where the
lock is important, it already exists so the directory isn't created
and the correct behaviour is guaranteed. On systems where the lock
isn't needed, it is created as a directory but that doesn't matter.

Future releases of Submariner will have to deal with this correctly,
and handle upgrades, ideally without mounting all of /run
permanently.

Signed-off-by: Stephen Kitt <[email protected]>
@skitt skitt force-pushed the revert-xtables-lock-mount branch from ea3ae55 to 62f56e6 Compare November 14, 2023 09:10
@submariner-bot submariner-bot added the ready-to-test When a PR is ready for full E2E testing label Nov 14, 2023
@tpantelis tpantelis enabled auto-merge (rebase) November 14, 2023 12:44
@tpantelis tpantelis merged commit b193cae into submariner-io:devel Nov 14, 2023
42 checks passed
@submariner-bot
Copy link
Contributor

🤖 Closed branches: [z_pr2889/skitt/revert-xtables-lock-mount]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport This change requires a backport to eligible release branches backport-handled ready-to-test When a PR is ready for full E2E testing
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants