@@ -35,7 +35,7 @@ var _ = Describe("vanilla ingress tests", func() {
35
35
ctx = context .Background ()
36
36
if tf .Options .ControllerImage != "" {
37
37
By (fmt .Sprintf ("ensure cluster installed with controller: %s" , tf .Options .ControllerImage ), func () {
38
- err := tf .CTRLInstallationManager .UpgradeController (tf .Options .ControllerImage )
38
+ err := tf .CTRLInstallationManager .UpgradeController (tf .Options .ControllerImage , false )
39
39
Expect (err ).NotTo (HaveOccurred ())
40
40
time .Sleep (60 * time .Second )
41
41
})
@@ -346,6 +346,57 @@ var _ = Describe("vanilla ingress tests", func() {
346
346
})
347
347
})
348
348
349
+ Context ("with ALB IP targets, named target port and endPointSlices enabled" , func () {
350
+ BeforeEach (func () {
351
+ ctx = context .Background ()
352
+ if tf .Options .ControllerImage != "" {
353
+ By (fmt .Sprintf ("upgrade controller with endPointSlices enabled." ), func () {
354
+ err := tf .CTRLInstallationManager .UpgradeController (tf .Options .ControllerImage , true )
355
+ Expect (err ).NotTo (HaveOccurred ())
356
+ time .Sleep (60 * time .Second )
357
+ })
358
+ }
359
+ })
360
+ It ("with 'alb.ingress.kubernetes.io/target-type' annotation explicitly specified, and endPointSlices enabled, one ALB shall be created and functional" , func () {
361
+ appBuilder := manifest .NewFixedResponseServiceBuilder ().WithTargetPortName ("e2e-targetport" )
362
+ ingBuilder := manifest .NewIngressBuilder ()
363
+ dp , svc := appBuilder .Build (sandboxNS .Name , "app" )
364
+ ingBackend := networking.IngressBackend {
365
+ Service : & networking.IngressServiceBackend {
366
+ Name : svc .Name ,
367
+ Port : networking.ServiceBackendPort {
368
+ Number : 80 ,
369
+ },
370
+ },
371
+ }
372
+ annotation := map [string ]string {
373
+ "kubernetes.io/ingress.class" : "alb" ,
374
+ "alb.ingress.kubernetes.io/scheme" : "internet-facing" ,
375
+ "alb.ingress.kubernetes.io/target-type" : "ip" ,
376
+ }
377
+ if tf .Options .IPFamily == "IPv6" {
378
+ annotation ["alb.ingress.kubernetes.io/ip-address-type" ] = "dualstack"
379
+ }
380
+ ing := ingBuilder .
381
+ AddHTTPRoute ("" , networking.HTTPIngressPath {Path : "/path" , PathType : & exact , Backend : ingBackend }).
382
+ WithAnnotations (annotation ).Build (sandboxNS .Name , "ing" )
383
+ resStack := fixture .NewK8SResourceStack (tf , dp , svc , ing )
384
+ err := resStack .Setup (ctx )
385
+ Expect (err ).NotTo (HaveOccurred ())
386
+
387
+ defer resStack .TearDown (ctx )
388
+
389
+ lbARN , lbDNS := ExpectOneLBProvisionedForIngress (ctx , tf , ing )
390
+
391
+ // test traffic
392
+ ExpectLBDNSBeAvailable (ctx , tf , lbARN , lbDNS )
393
+ httpExp := httpexpect .New (tf .LoggerReporter , fmt .Sprintf ("http://%v" , lbDNS ))
394
+ httpExp .GET ("/path" ).Expect ().
395
+ Status (http .StatusOK ).
396
+ Body ().Equal ("Hello World!" )
397
+ })
398
+ })
399
+
349
400
Context ("with `alb.ingress.kubernetes.io/actions.${action-name}` variant settings" , func () {
350
401
It ("with annotation based actions, one ALB shall be created and functional" , func () {
351
402
appBuilder := manifest .NewFixedResponseServiceBuilder ()
0 commit comments