orange-cloudfoundry / k3s-wrapper-boshrelease

k3s wrapper scripts bosh release
Apache License 2.0
2 stars 2 forks source link

k3s post-stop killall. clean ip tables in a compatible mode (flannel / cilium) #10

Closed poblin-orange closed 7 months ago

poblin-orange commented 1 year ago

the k3s community provides a k3skillall script. This file has been adapted for bosh context and included in the bosh release, as bosh post-stop hook.

This should include iptables clean, but the provided syntax is hardcoded to flannel. Should also be compatible with CNI like cilium.

As of 124.11, iptables clean is commented in bosh release script

NB: check iptables-save missing iptables rules, jammy stemcell 1.95 ? This might break the vm when using iptables-restore

https://rancher-users.slack.com/archives/CGGQEHPPW/p1693944968527389

poblin-orange commented 9 months ago

see cilium specific cleanup in addition to k3skillall https://docs.k3s.io/installation/network-options#custom-cni

Before running k3s-killall.sh or k3s-uninstall.sh, you must manually remove cilium_host, cilium_net and cilium_vxlan interfaces. If you fail to do this, you may lose network connectivity to the host when K3s is stopped ip link delete cilium_host ip link delete cilium_net ip link delete cilium_vxlan

Additionally, iptables rules for cilium should be removed: iptables-save | grep -iv cilium | iptables-restore ip6tables-save | grep -iv cilium | ip6tables-restore