Skip to content

Commit 2d5f148

Browse files
committed
Add feature.LoadBalancer and remove provider-based skips from LB tests
1 parent 582a495 commit 2d5f148

File tree

2 files changed

+27
-43
lines changed

2 files changed

+27
-43
lines changed

test/e2e/feature/feature.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ var (
175175
// TODO: document the feature (owning SIG, when to use this feature for a test)
176176
LabelSelector = framework.WithFeature(framework.ValidFeatures.Add("LabelSelector"))
177177

178+
// Owner: sig-network
179+
// Marks tests that require a cloud provider that implements LoadBalancer Services
180+
LoadBalancer = framework.WithFeature(framework.ValidFeatures.Add("LoadBalancer"))
181+
178182
// TODO: document the feature (owning SIG, when to use this feature for a test)
179183
LocalStorageCapacityIsolation = framework.WithFeature(framework.ValidFeatures.Add("LocalStorageCapacityIsolation"))
180184

test/e2e/network/loadbalancer.go

Lines changed: 23 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build !providerless
2-
// +build !providerless
3-
41
/*
52
Copyright 2016 The Kubernetes Authors.
63
@@ -42,6 +39,7 @@ import (
4239
clientset "k8s.io/client-go/kubernetes"
4340
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
4441
e2eapps "k8s.io/kubernetes/test/e2e/apps"
42+
"k8s.io/kubernetes/test/e2e/feature"
4543
"k8s.io/kubernetes/test/e2e/framework"
4644
e2edaemonset "k8s.io/kubernetes/test/e2e/framework/daemonset"
4745
e2edeployment "k8s.io/kubernetes/test/e2e/framework/deployment"
@@ -116,7 +114,7 @@ func getReadySchedulableWorkerNode(ctx context.Context, c clientset.Interface) (
116114
return nil, fmt.Errorf("there are currently no ready, schedulable worker nodes in the cluster")
117115
}
118116

119-
var _ = common.SIGDescribe("LoadBalancers", func() {
117+
var _ = common.SIGDescribe("LoadBalancers", feature.LoadBalancer, func() {
120118
f := framework.NewDefaultFramework("loadbalancers")
121119
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
122120

@@ -133,13 +131,8 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
133131
})
134132

135133
f.It("should be able to change the type and ports of a TCP service", f.WithSlow(), func(ctx context.Context) {
136-
// requires cloud load-balancer support
137-
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws")
138-
139-
loadBalancerLagTimeout := e2eservice.LoadBalancerLagTimeoutDefault
140-
if framework.ProviderIs("aws") {
141-
loadBalancerLagTimeout = e2eservice.LoadBalancerLagTimeoutAWS
142-
}
134+
// FIXME: need a better platform-independent timeout
135+
loadBalancerLagTimeout := e2eservice.LoadBalancerLagTimeoutAWS
143136
loadBalancerCreateTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs)
144137

145138
// This test is more monolithic than we'd like because LB turnup can be
@@ -276,8 +269,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
276269
})
277270

278271
f.It("should be able to change the type and ports of a UDP service", f.WithSlow(), func(ctx context.Context) {
279-
// requires cloud load-balancer support
280-
e2eskipper.SkipUnlessProviderIs("gce", "gke")
272+
// FIXME: some cloud providers do not support UDP LoadBalancers
281273

282274
loadBalancerLagTimeout := e2eservice.LoadBalancerLagTimeoutDefault
283275
loadBalancerCreateTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs)
@@ -428,9 +420,6 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
428420
})
429421

430422
f.It("should only allow access from service loadbalancer source ranges", f.WithSlow(), func(ctx context.Context) {
431-
// this feature currently supported only on GCE/GKE/AWS/AZURE
432-
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws", "azure")
433-
434423
loadBalancerCreateTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs)
435424

436425
namespace := f.Namespace.Name
@@ -513,8 +502,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
513502

514503
// [LinuxOnly]: Windows does not support session affinity.
515504
f.It("should have session affinity work for LoadBalancer service with ESIPP on", f.WithSlow(), "[LinuxOnly]", func(ctx context.Context) {
516-
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
517-
e2eskipper.SkipIfProviderIs("aws")
505+
// FIXME: some cloud providers do not support k8s-compatible affinity
518506

519507
svc := getServeHostnameService("affinity-lb-esipp")
520508
svc.Spec.Type = v1.ServiceTypeLoadBalancer
@@ -524,8 +512,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
524512

525513
// [LinuxOnly]: Windows does not support session affinity.
526514
f.It("should be able to switch session affinity for LoadBalancer service with ESIPP on", f.WithSlow(), "[LinuxOnly]", func(ctx context.Context) {
527-
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
528-
e2eskipper.SkipIfProviderIs("aws")
515+
// FIXME: some cloud providers do not support k8s-compatible affinity
529516

530517
svc := getServeHostnameService("affinity-lb-esipp-transition")
531518
svc.Spec.Type = v1.ServiceTypeLoadBalancer
@@ -535,8 +522,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
535522

536523
// [LinuxOnly]: Windows does not support session affinity.
537524
f.It("should have session affinity work for LoadBalancer service with ESIPP off", f.WithSlow(), "[LinuxOnly]", func(ctx context.Context) {
538-
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
539-
e2eskipper.SkipIfProviderIs("aws")
525+
// FIXME: some cloud providers do not support k8s-compatible affinity
540526

541527
svc := getServeHostnameService("affinity-lb")
542528
svc.Spec.Type = v1.ServiceTypeLoadBalancer
@@ -546,8 +532,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
546532

547533
// [LinuxOnly]: Windows does not support session affinity.
548534
f.It("should be able to switch session affinity for LoadBalancer service with ESIPP off", f.WithSlow(), "[LinuxOnly]", func(ctx context.Context) {
549-
// L4 load balancer affinity `ClientIP` is not supported on AWS ELB.
550-
e2eskipper.SkipIfProviderIs("aws")
535+
// FIXME: some cloud providers do not support k8s-compatible affinity
551536

552537
svc := getServeHostnameService("affinity-lb-transition")
553538
svc.Spec.Type = v1.ServiceTypeLoadBalancer
@@ -594,13 +579,8 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
594579
})
595580

596581
f.It("should be able to create LoadBalancer Service without NodePort and change it", f.WithSlow(), func(ctx context.Context) {
597-
// requires cloud load-balancer support
598-
e2eskipper.SkipUnlessProviderIs("gce", "gke", "aws")
599-
600-
loadBalancerLagTimeout := e2eservice.LoadBalancerLagTimeoutDefault
601-
if framework.ProviderIs("aws") {
602-
loadBalancerLagTimeout = e2eservice.LoadBalancerLagTimeoutAWS
603-
}
582+
// FIXME: need a better platform-independent timeout
583+
loadBalancerLagTimeout := e2eservice.LoadBalancerLagTimeoutAWS
604584
loadBalancerCreateTimeout := e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs)
605585

606586
// This test is more monolithic than we'd like because LB turnup can be
@@ -664,8 +644,8 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
664644
})
665645

666646
ginkgo.It("should be able to preserve UDP traffic when server pod cycles for a LoadBalancer service on different nodes", func(ctx context.Context) {
667-
// requires cloud load-balancer support
668-
e2eskipper.SkipUnlessProviderIs("gce", "gke", "azure")
647+
// FIXME: some cloud providers do not support UDP LoadBalancers
648+
669649
ns := f.Namespace.Name
670650
nodes, err := e2enode.GetBoundedReadySchedulableNodes(ctx, cs, 2)
671651
framework.ExpectNoError(err)
@@ -796,8 +776,8 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
796776
})
797777

798778
ginkgo.It("should be able to preserve UDP traffic when server pod cycles for a LoadBalancer service on the same nodes", func(ctx context.Context) {
799-
// requires cloud load-balancer support
800-
e2eskipper.SkipUnlessProviderIs("gce", "gke", "azure")
779+
// FIXME: some cloud providers do not support UDP LoadBalancers
780+
801781
ns := f.Namespace.Name
802782
nodes, err := e2enode.GetBoundedReadySchedulableNodes(ctx, cs, 1)
803783
framework.ExpectNoError(err)
@@ -946,7 +926,12 @@ var _ = common.SIGDescribe("LoadBalancers", func() {
946926
})
947927
})
948928

949-
var _ = common.SIGDescribe("LoadBalancers ESIPP", framework.WithSlow(), func() {
929+
var _ = common.SIGDescribe("LoadBalancers ESIPP", feature.LoadBalancer, framework.WithSlow(), func() {
930+
// FIXME: What are the expected semantics of requesting an
931+
// "ExternalTrafficPolicy: Local" service from a cloud provider that does not
932+
// support that? What are the expected semantics of "ExternalTrafficPolicy: Local"
933+
// on `IPMode: Proxy`-type LoadBalancers?
934+
950935
f := framework.NewDefaultFramework("esipp")
951936
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
952937
var loadBalancerCreateTimeout time.Duration
@@ -956,9 +941,6 @@ var _ = common.SIGDescribe("LoadBalancers ESIPP", framework.WithSlow(), func() {
956941
var err error
957942

958943
ginkgo.BeforeEach(func(ctx context.Context) {
959-
// requires cloud load-balancer support - this feature currently supported only on GCE/GKE
960-
e2eskipper.SkipUnlessProviderIs("gce", "gke")
961-
962944
cs = f.ClientSet
963945
loadBalancerCreateTimeout = e2eservice.GetServiceLoadBalancerCreationTimeout(ctx, cs)
964946
subnetPrefix, err = getSubnetPrefix(ctx, cs)
@@ -1415,10 +1397,8 @@ func testRollingUpdateLBConnectivityDisruption(ctx context.Context, f *framework
14151397
svcPort := int(service.Spec.Ports[0].Port)
14161398

14171399
ginkgo.By("Hitting the DaemonSet's pods through the service's load balancer")
1418-
timeout := e2eservice.LoadBalancerLagTimeoutDefault
1419-
if framework.ProviderIs("aws") {
1420-
timeout = e2eservice.LoadBalancerLagTimeoutAWS
1421-
}
1400+
// FIXME: need a better platform-independent timeout
1401+
timeout := e2eservice.LoadBalancerLagTimeoutAWS
14221402
e2eservice.TestReachableHTTP(ctx, lbNameOrAddress, svcPort, timeout)
14231403

14241404
ginkgo.By("Starting a goroutine to continuously hit the DaemonSet's pods through the service's load balancer")

0 commit comments

Comments
 (0)