Score:0

How to delete all the iptables records created when the node was part of a k8s cluster?

br flag

This is a continuation to https://stackoverflow.com/questions/25055121/can-i-remove-multiple-matching-rules-with-the-iptables-delete-command

The answer https://stackoverflow.com/a/53404390/80002 is very useful - I was able to delete most of the entries. However, some entries are still there, but they do not look like ordinary rules:

student@worker:~$ sudo iptables-save | grep -iE "kub|cali"
:cali-OUTPUT - [0:0]
:cali-PREROUTING - [0:0]
:cali-from-host-endpoint - [0:0]
:cali-rpf-skip - [0:0]
:cali-to-host-endpoint - [0:0]
:KUBE-IPTABLES-HINT - [0:0]
:KUBE-KUBELET-CANARY - [0:0]
:KUBE-PROXY-CANARY - [0:0]
:cali-POSTROUTING - [0:0]
...
:cali-fip-snat - [0:0]
:cali-nat-outgoing - [0:0]
student@worker:~$

There are all in all 54 records like them. They do not look like rules. What are they? How can they be purged?

pt flag
Why not just flush all the rules, and then set up your desired configuration?
mark avatar
br flag
I do not know how to do it. I do not know what rules should be there. I only know which should not, so I want to remove just them.
mark avatar
br flag
@larsks - I did some reading and I understand what you mean. I am OK with flushing. I actually found on the internet how to flush iptables. But I prefer you answering it, so that I could credit you.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.