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

Clean up network interfaces #712

Closed
knkski opened this issue Oct 8, 2019 · 4 comments
Closed

Clean up network interfaces #712

knkski opened this issue Oct 8, 2019 · 4 comments
Labels
inactive kind/support Question with a workaround

Comments

@knkski
Copy link
Contributor

knkski commented Oct 8, 2019

Spinning up containers in microk8s leaves a lot of network interfaces behind. Would it be possible to have some way of cleaning those up, either by adding that functionality to microk8s.reset, or by having a specific command to clean them up? Cleaning them up this way worked for me:

ip a | grep -o "veth[a-z0-9]\+" | xargs -I[] sudo ip link delete []

Note that there shouldn't be anything else on my system that was creating the veth* interfaces, but the command above might be too aggressive on other systems that have something other than microk8s creating virtual interfaces.

@knkski
Copy link
Contributor Author

knkski commented Oct 8, 2019

I also ended up with a flannel.1 network that was presumably created by microk8s, and that persisted after I snap uninstalled microk8s. Is that something that could get cleaned up during snap uninstall?

@ktsakalozos ktsakalozos added the kind/support Question with a workaround label Oct 8, 2019
@rubenst2013
Copy link

I too would expect microk8s to clean up after itself when uninstalling the snap.

At least it could provide a human/script-readable list of the network links it created over its lifetime on the system, so the admin has a starting point to fine tune cleanup or simply plug them all into a remove script.

(makes me wonder what else microk8s may leave behind, kids clean up your room please ;) )

@ktsakalozos
Copy link
Member

The veth* interfaces are created by the CNI implementation (flannel in this case). Note that other CNIs may name their interfaces differently. The right way to remove these is to ask Kubernetes to delete the deployments/pods and the CNI should take care of the interfaces.

On the flannel.1, we could delete it during the removal of the snap as we do with the cni0 (https://github.com/ubuntu/microk8s/blob/master/snap/hooks/remove#L37), as long as we know we created it, right? We may want to have a flag indicating we were the ones created this interface.

@stale
Copy link

stale bot commented Dec 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive label Dec 2, 2020
@stale stale bot closed this as completed Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive kind/support Question with a workaround
Projects
None yet
Development

No branches or pull requests

3 participants