Skip to content

Add mount and network options to the cleanup of network rules#54477

Open
kayoch1n wants to merge 2 commits intokubernetes:mainfrom
kayoch1n:fix-cleanup-network-rules
Open

Add mount and network options to the cleanup of network rules#54477
kayoch1n wants to merge 2 commits intokubernetes:mainfrom
kayoch1n:fix-cleanup-network-rules

Conversation

@kayoch1n
Copy link

@kayoch1n kayoch1n commented Feb 16, 2026

Description

This PR attempts to make minor changes to the command of the network traffic cleanup:

  1. mount volume of /lib/modules, and
  2. add --network=host

Firstly, the cleanup runs inside container and invokes the command kube-proxy --cleanup, which instead invokes modprobe -va ip_vs and fails due to the fact that /lib/modules is not mounted.

root@server:~# docker run --privileged --rm registry.k8s.io/kube-proxy:v1.33.8 sh -c "kube-proxy --cleanup && echo DONE"
I0216 08:55:39.440757       7 server_linux.go:63] "Using iptables proxy"
time="2026-02-16T08:55:39Z" level=warning msg="Running modprobe ip_vs failed with message: `modprobe: WARNING: Module ip_vs not found in directory /lib/modules/6.8.0-90-generic`, error: exit status 1"
DONE

This warning won't cause kubeproxy to fail, but it is somewhat frustrating. Adding read-only mount of -v /lib/modules:/lib/modules:ro eliminate this warning.

root@server:~# docker run --privileged -v /lib/modules:/lib/modules:ro --rm registry.k8s.io/kube-proxy:v1.33.8 sh -c "kube-proxy --cleanup && echo DONE"
I0216 08:55:46.996953       7 server_linux.go:63] "Using iptables proxy"
DONE
root@iZ7xveqxt3ym1f0kxdwb47Z:~# 

Secondly, without --network=host, kube-proxy inside container cannot touch the host's network namespace. Adding this option allows kube-proxy to remove iptable rules.

Issue

Closes: #

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 16, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @kayoch1n!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 16, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign salaxander for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. language/en Issues or PRs related to English language labels Feb 16, 2026
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 16, 2026
@netlify
Copy link

netlify bot commented Feb 16, 2026

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit e64df83
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/69933483d20b1f00082c8034
😎 Deploy Preview https://deploy-preview-54477--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kayoch1n kayoch1n changed the title Add mount args to the cleanup of network rules Add mount and network options to the cleanup of network rules Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants