@@ -111,6 +111,18 @@ var iptablesChains = []struct {
111
111
{utiliptables .TableFilter , KubeForwardChain },
112
112
}
113
113
114
+ var iptablesCleanupChains = []struct {
115
+ table utiliptables.Table
116
+ chain utiliptables.Chain
117
+ }{
118
+ {utiliptables .TableNAT , kubeServicesChain },
119
+ {utiliptables .TableNAT , kubePostroutingChain },
120
+ {utiliptables .TableNAT , KubeFireWallChain },
121
+ {utiliptables .TableNAT , KubeNodePortChain },
122
+ {utiliptables .TableNAT , KubeLoadBalancerChain },
123
+ {utiliptables .TableFilter , KubeForwardChain },
124
+ }
125
+
114
126
// ipsetInfo is all ipset we needed in ipvs proxier
115
127
var ipsetInfo = []struct {
116
128
name string
@@ -639,7 +651,7 @@ func cleanupIptablesLeftovers(ipt utiliptables.Interface) (encounteredError bool
639
651
}
640
652
641
653
// Flush and remove all of our chains. Flushing all chains before removing them also removes all links between chains first.
642
- for _ , ch := range iptablesChains {
654
+ for _ , ch := range iptablesCleanupChains {
643
655
if err := ipt .FlushChain (ch .table , ch .chain ); err != nil {
644
656
if ! utiliptables .IsNotFoundError (err ) {
645
657
klog .Errorf ("Error removing iptables rules in ipvs proxier: %v" , err )
@@ -649,7 +661,7 @@ func cleanupIptablesLeftovers(ipt utiliptables.Interface) (encounteredError bool
649
661
}
650
662
651
663
// Remove all of our chains.
652
- for _ , ch := range iptablesChains {
664
+ for _ , ch := range iptablesCleanupChains {
653
665
if err := ipt .DeleteChain (ch .table , ch .chain ); err != nil {
654
666
if ! utiliptables .IsNotFoundError (err ) {
655
667
klog .Errorf ("Error removing iptables rules in ipvs proxier: %v" , err )
0 commit comments