@@ -117,10 +117,16 @@ var iptablesChains = []struct {
117
117
{utiliptables .TableNAT , KubeNodePortChain },
118
118
{utiliptables .TableNAT , KubeLoadBalancerChain },
119
119
{utiliptables .TableNAT , KubeMarkMasqChain },
120
- {utiliptables .TableNAT , KubeMarkDropChain },
121
120
{utiliptables .TableFilter , KubeForwardChain },
122
121
}
123
122
123
+ var iptablesEnsureChains = []struct {
124
+ table utiliptables.Table
125
+ chain utiliptables.Chain
126
+ }{
127
+ {utiliptables .TableNAT , KubeMarkDropChain },
128
+ }
129
+
124
130
var iptablesCleanupChains = []struct {
125
131
table utiliptables.Table
126
132
chain utiliptables.Chain
@@ -1858,6 +1864,14 @@ func (proxier *Proxier) createAndLinkeKubeChain() {
1858
1864
existingFilterChains := proxier .getExistingChains (proxier .filterChainsData , utiliptables .TableFilter )
1859
1865
existingNATChains := proxier .getExistingChains (proxier .iptablesData , utiliptables .TableNAT )
1860
1866
1867
+ // ensure KUBE-MARK-DROP chain exist but do not change any rules
1868
+ for _ , ch := range iptablesEnsureChains {
1869
+ if _ , err := proxier .iptables .EnsureChain (ch .table , ch .chain ); err != nil {
1870
+ klog .Errorf ("Failed to ensure that %s chain %s exists: %v" , ch .table , ch .chain , err )
1871
+ return
1872
+ }
1873
+ }
1874
+
1861
1875
// Make sure we keep stats for the top-level chains
1862
1876
for _ , ch := range iptablesChains {
1863
1877
if _ , err := proxier .iptables .EnsureChain (ch .table , ch .chain ); err != nil {
0 commit comments