mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Add test for trafficDistribution: PreferSameZone
(Identical to the PreferClose test.)
This commit is contained in:
parent
23aff5dabd
commit
7956b37f62
@ -29,6 +29,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/intstr"
|
"k8s.io/apimachinery/pkg/util/intstr"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
"k8s.io/kubernetes/pkg/features"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||||
@ -260,10 +261,17 @@ var _ = common.SIGDescribe("Traffic Distribution", func() {
|
|||||||
// Main test specifications.
|
// Main test specifications.
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ginkgo.It("should route traffic to an endpoint in the same zone when using PreferClose", func(ctx context.Context) {
|
framework.It("should route traffic to an endpoint in the same zone when using PreferClose", func(ctx context.Context) {
|
||||||
clientPods, serverPods := allocateClientsAndServers(ctx)
|
clientPods, serverPods := allocateClientsAndServers(ctx)
|
||||||
svc := createService(ctx, v1.ServiceTrafficDistributionPreferClose)
|
svc := createService(ctx, v1.ServiceTrafficDistributionPreferClose)
|
||||||
createPods(ctx, svc, clientPods, serverPods)
|
createPods(ctx, svc, clientPods, serverPods)
|
||||||
checkTrafficDistribution(ctx, clientPods)
|
checkTrafficDistribution(ctx, clientPods)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
framework.It("should route traffic to an endpoint in the same zone when using PreferSameZone", framework.WithFeatureGate(features.PreferSameTrafficDistribution), func(ctx context.Context) {
|
||||||
|
clientPods, serverPods := allocateClientsAndServers(ctx)
|
||||||
|
svc := createService(ctx, v1.ServiceTrafficDistributionPreferSameZone)
|
||||||
|
createPods(ctx, svc, clientPods, serverPods)
|
||||||
|
checkTrafficDistribution(ctx, clientPods)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user