Skip to content

Commit 7e1cfca

Browse files
authored
Merge pull request kubernetes#126110 from chengjoey/docs/e2e-pod-traffic
add some notes for e2e preserve source pod ip test
2 parents 1304149 + 4713391 commit 7e1cfca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/e2e/network/service.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,9 @@ var _ = common.SIGDescribe("Services", func() {
986986
framework.ExpectNoError(err)
987987
})
988988

989+
// NOTE: base on fundamental requirement of the kubernetes networking model(https://kubernetes.io/docs/concepts/services-networking/)
990+
// pods can communicate with all other pods on any other node without NAT
991+
// we should avoid masquerading the internal Pod traffic, detail see #126089
989992
ginkgo.It("should preserve source pod IP for traffic thru service cluster IP [LinuxOnly]", func(ctx context.Context) {
990993
// this test is creating a pod with HostNetwork=true, which is not supported on Windows.
991994
e2eskipper.SkipIfNodeOSDistroIs("windows")
@@ -1055,7 +1058,9 @@ var _ = common.SIGDescribe("Services", func() {
10551058
for _, pausePod := range pausePods.Items {
10561059
sourceIP, execPodIP := execSourceIPTest(pausePod, serviceAddress)
10571060
ginkgo.By("Verifying the preserved source ip")
1058-
gomega.Expect(sourceIP).To(gomega.Equal(execPodIP))
1061+
gomega.Expect(sourceIP).To(gomega.Equal(execPodIP),
1062+
"expected preserved source IP is %s, if not, please check whether the internal pod traffic is masqueraded",
1063+
sourceIP)
10591064
}
10601065
})
10611066

0 commit comments

Comments
 (0)