大网数据广告活动
服务器运维问答

How can I delete manually calicoctl and iptables created by calico from my k3s setup

· 52CE 我爱测

I have a K3s setup with calico pods [ calico-node- & calico-kube-controllers- ] running. On uninstalling K3s, calico pods get deleted but I see that calicoctl and iptables -S commands still running and shows data. I want to delet…

问题原文

原帖链接 · solveit · CC BY-SA 4.0

I have a K3s setup with calico pods [calico-node- & calico-kube-controllers-] running. On uninstalling K3s, calico pods get deleted but I see that calicoctl and iptables -S commands still running and shows data.

I want to delete calico (including calicoctl and Iptables created by calico) completely. Which commands will help me to do so ?

K3s uninstalltion command: /usr/local/bin/k3s-uninstall.sh deletes all k3s pods including calico, but calicoctl and iptables -S still works.

PS: I already tried few things -

  1. Command kubectl delete -f https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/release-1.5/config/v1.5/calico.yaml deletes the calico-node- but calico-kube-controller , calicoctl and iptables -S are still present
  2. Kubectl delete commands in this que also not working for me, after executing these two commands still calicoctl and iptables -S are present

已采纳解答

原帖链接 · gaurav sinha · CC BY-SA 4.0

Deleting calico-Iptables:

Use calico-policy and add below lines at the end of script:

echo "Flush remaining calico iptables"
iptables-save | grep -i cali | iptables -F

echo "Delete remaining calico iptables"
iptables-save | grep -i cali | iptables -X

This will delete all calico iptables when you check with iptables -S

Note: Run this script only after uninstalling K3S.

Deleting calicoctl:

Simply run sudo rm $(which calicoctl) command, it will find and delete the calicoctl.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-08-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。