kubeovn / kube-ovn

A Bridge between SDN and Cloud Native (Project under CNCF)
https://kubeovn.github.io/docs/stable/en/
Apache License 2.0
1.87k stars 433 forks source link

[BUG] Unable to delete subnet due to leftover IP #4243

Closed reski-rukmantiyo closed 2 days ago

reski-rukmantiyo commented 4 days ago

Kube-OVN Version

v1.12.12

Kubernetes Version

Client Version: v1.30.2 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.30.0

Operation-system/Kernel Version

"Ubuntu 22.04.4 LTS" 5.15.0-113-generic

Description

Try to create script from Config VPC. All the scripts is compiled into 1 file. Due to problem in #4241, I try to delete using the same file kubectl delete -f config-vpc.yaml.

After wait a few minutes, got these messages

E0630 03:56:23.001854      13 subnet.go:921] inconsistency detected in status of subnet attach-subnet : subnet attach-subnet has 1 v4 ip in use, while the v4 using ip range is empty
E0630 03:56:23.001927      13 subnet.go:246] error syncing 'attach-subnet': subnet attach-subnet has 1 v4 ip in use, while the v4 using ip range is empty, requeuing

Steps To Reproduce

  1. Compile Config VPC into 1 file
  2. kubectl apply -f config-vpc.yaml
  3. kubectl delete -f config-vpc.yaml

Current Behavior

Subnet cannot be delete due to multus net-attachment-def deleted first before subnet. When i try to apply the net-attachment-def again, then delete, somehow it dont work.

Solution is to delete leftover ip in kubectl get ip, then check for name of deleted subnet.

Expected Behavior

Subnet can be delete although net-attachment-def already deleted

bobz965 commented 4 days ago

how about deleting the ip manually before deleting the subnet ?

reski-rukmantiyo commented 3 days ago

Yes, this is possible to have a routine to delete all ips that related with those subnet.

bobz965 commented 2 days ago

user should make sure all ips is deleted before deleting subnet.

reski-rukmantiyo commented 2 days ago

yes, thanks for this. Let me close this.