Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable nlb-instance e2e tests for ipv6 #3407

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 23 additions & 13 deletions test/e2e/service/nlb_instance_target_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
Expect(err).NotTo(HaveOccurred())
})
Context("with NLB instance target configuration", func() {
annotation := make(map[string]string)
BeforeEach(func() {
if tf.Options.IPFamily == "IPv6" {
annotation["service.beta.kubernetes.io/aws-load-balancer-ip-address-type"] = "dualstack"
}
})
It("should provision internet-facing load balancer resources", func() {
annotation["service.beta.kubernetes.io/aws-load-balancer-scheme"] = "internet-facing"
By("deploying stack", func() {
err := stack.Deploy(ctx, tf, nil)
err := stack.Deploy(ctx, tf, annotation)
Expect(err).NotTo(HaveOccurred())
})

Expand Down Expand Up @@ -156,9 +163,8 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
})
It("should provision internal load-balancer resources", func() {
By("deploying stack", func() {
err := stack.Deploy(ctx, tf, map[string]string{
"service.beta.kubernetes.io/aws-load-balancer-scheme": "internal",
})
annotation["service.beta.kubernetes.io/aws-load-balancer-scheme"] = "internal"
err := stack.Deploy(ctx, tf, annotation)
Expect(err).NotTo(HaveOccurred())
})
By("checking service status for lb dns name", func() {
Expand Down Expand Up @@ -217,9 +223,9 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
Skip("Skipping tests, certificates not specified")
}
By("deploying stack", func() {
err := stack.Deploy(ctx, tf, map[string]string{
"service.beta.kubernetes.io/aws-load-balancer-ssl-cert": tf.Options.CertificateARNs,
})
annotation["service.beta.kubernetes.io/aws-load-balancer-ssl-cert"] = tf.Options.CertificateARNs
annotation["service.beta.kubernetes.io/aws-load-balancer-scheme"] = "internet-facing"
err := stack.Deploy(ctx, tf, annotation)
Expect(err).NotTo(HaveOccurred())
})
By("checking service status for lb dns name", func() {
Expand Down Expand Up @@ -280,9 +286,8 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
})
It("should enable proxy protocol v2", func() {
By("deploying stack", func() {
err := stack.Deploy(ctx, tf, map[string]string{
"service.beta.kubernetes.io/aws-load-balancer-proxy-protocol": "*",
})
annotation["service.beta.kubernetes.io/aws-load-balancer-proxy-protocol"] = "*"
err := stack.Deploy(ctx, tf, annotation)
Expect(err).ToNot(HaveOccurred())
dnsName = stack.GetLoadBalancerIngressHostName()
Expect(dnsName).ToNot(BeEmpty())
Expand Down Expand Up @@ -316,11 +321,16 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
})

Context("with NLB instance target configuration with target node labels", func() {
annotation := make(map[string]string)
BeforeEach(func() {
if tf.Options.IPFamily == "IPv6" {
annotation["service.beta.kubernetes.io/aws-load-balancer-ip-address-type"] = "dualstack"
}
})
It("should add only the labelled nodes to the target group", func() {
By("deploying stack", func() {
err := stack.Deploy(ctx, tf, map[string]string{
"service.beta.kubernetes.io/aws-load-balancer-target-node-labels": "service.node.label/key1=value1",
})
annotation["service.beta.kubernetes.io/aws-load-balancer-target-node-labels"] = "service.node.label/key1=value1"
err := stack.Deploy(ctx, tf, annotation)
Expect(err).ToNot(HaveOccurred())
dnsName = stack.GetLoadBalancerIngressHostName()
Expect(dnsName).ToNot(BeEmpty())
Expand Down
Loading