@@ -17,6 +17,7 @@ limitations under the License.
17
17
package network
18
18
19
19
import (
20
+ "context"
20
21
"fmt"
21
22
"strings"
22
23
"time"
@@ -116,6 +117,9 @@ var _ = SIGDescribe("Conntrack", func() {
116
117
})
117
118
118
119
ginkgo .It ("should be able to preserve UDP traffic when server pod cycles for a NodePort service" , func () {
120
+ // TODO(#91236): Remove once the test is debugged and fixed.
121
+ // dump conntrack table for debugging
122
+ defer dumpConntrack (cs )
119
123
120
124
// Create a NodePort service
121
125
udpJig := e2eservice .NewTestJig (cs , ns , serviceName )
@@ -193,6 +197,9 @@ var _ = SIGDescribe("Conntrack", func() {
193
197
})
194
198
195
199
ginkgo .It ("should be able to preserve UDP traffic when server pod cycles for a ClusterIP service" , func () {
200
+ // TODO(#91236): Remove once the test is debugged and fixed.
201
+ // dump conntrack table for debugging
202
+ defer dumpConntrack (cs )
196
203
197
204
// Create a ClusterIP service
198
205
udpJig := e2eservice .NewTestJig (cs , ns , serviceName )
@@ -269,3 +276,24 @@ var _ = SIGDescribe("Conntrack", func() {
269
276
}
270
277
})
271
278
})
279
+
280
+ func dumpConntrack (cs clientset.Interface ) {
281
+ // Dump conntrack table of each node for troubleshooting using the kube-proxy pods
282
+ namespace := "kube-system"
283
+ pods , err := cs .CoreV1 ().Pods (namespace ).List (context .TODO (), metav1.ListOptions {})
284
+ if err != nil || len (pods .Items ) == 0 {
285
+ framework .Logf ("failed to list kube-proxy pods in namespace: %s" , namespace )
286
+ return
287
+ }
288
+ cmd := "conntrack -L"
289
+ for _ , pod := range pods .Items {
290
+ if strings .Contains (pod .Name , "kube-proxy" ) {
291
+ stdout , err := framework .RunHostCmd (namespace , pod .Name , cmd )
292
+ if err != nil {
293
+ framework .Logf ("Failed to dump conntrack table of node %s: %v" , pod .Spec .NodeName , err )
294
+ continue
295
+ }
296
+ framework .Logf ("conntrack table of node %s: %s" , pod .Spec .NodeName , stdout )
297
+ }
298
+ }
299
+ }
0 commit comments