h3poteto / aws-global-accelerator-controller

A Kubernetes controller for Global Accelerators and Route53
Apache License 2.0
26 stars 8 forks source link

The controller is creating, failing and deleting the GA in a loop #134

Closed midestefanis closed 6 months ago

midestefanis commented 1 year ago
I1011 18:26:31.268407       1 global_accelerator.go:103] LoadBalancer is arn:aws:elasticloadbalancing:us-east-1:***************:loadbalancer/net/****-nlb/49945680e192d1f8
I1011 18:26:31.707143       1 global_accelerator.go:111] Creating Global Accelerator for ************.elb.us-east-1.amazonaws.com
I1011 18:26:31.707166       1 global_accelerator.go:571] Creating Global Accelerator service-shadow-****-nlb
I1011 18:26:32.966339       1 global_accelerator.go:599] Global Accelerator is created: arn:aws:globalaccelerator::***************:accelerator/***************
I1011 18:26:33.131018       1 global_accelerator.go:727] Listener is created: arn:aws:globalaccelerator::***************:accelerator/***************/listener/9671a283
E1011 18:26:33.694719       1 global_accelerator.go:114] InvalidArgumentException: ClientIPPreservation must be enabled for internal facing network load balancer: arn:aws:elasticloadbalancing:us-east-1:***************:loadbalancer/net/****-nlb/49945680e192d1f8
W1011 18:26:33.694807       1 global_accelerator.go:116] Failed to create Global Accelerator, but some resources are created, so cleanup arn:aws:globalaccelerator::***************:accelerator/***************
I1011 18:26:34.252709       1 global_accelerator.go:761] Listener is deleted: arn:aws:globalaccelerator::***************:accelerator/***************/listener/9671a283
I1011 18:26:34.252796       1 global_accelerator.go:642] Disabling Global Accelerator arn:aws:globalaccelerator::***************:accelerator/***************
I1011 18:26:44.513364       1 global_accelerator.go:664] Global Accelerator arn:aws:globalaccelerator::***************:accelerator/*************** is IN_PROGRESS, so waiting
I1011 18:26:54.515458       1 global_accelerator.go:664] Global Accelerator arn:aws:globalaccelerator::***************:accelerator/*************** is IN_PROGRESS, so waiting
I1011 18:27:04.515265       1 global_accelerator.go:661] Global Accelerator arn:aws:globalaccelerator::***************:accelerator/*************** is DEPLOYED
I1011 18:27:05.578089       1 global_accelerator.go:680] Global Accelerator is deleted: arn:aws:globalaccelerator::***************:accelerator/***************
E1011 18:27:05.578136       1 reconcile.go:37] error syncing "shadow/****-nlb", and requeued: InvalidArgumentException: ClientIPPreservation must be enabled for internal facing network load balancer: arn:aws:elasticloadbalancing:us-east-1:***************:loadbalancer/net/****-nlb/49945680e192d1f8

The controller is creating and deleting the GA in a loop. It's complaining about the missing ClientIPPreservation argument but that's not accurate, the NLB is configured to Preserve the IP.

image

h3poteto commented 6 months ago

I can reproduce this. Thanks.

However, in the first place, why do you want to use Global Accelerator for Internal Load Balancer? I don't know what situations you would want it.

h3poteto commented 6 months ago

InvalidArgumentException: ClientIPPreservation must be enabled for internal facing network load balancer

I got it. This error says when you use internal NLB for Global Accelerator you need to enable ClientIPPreservation in Global Accelerator. It is not an option in TargetGroup. So, I added the option: https://github.com/h3poteto/aws-global-accelerator-controller/pull/147 Please use version 0.11.1. And here is an example service manifest: https://github.com/h3poteto/aws-global-accelerator-controller/blob/08939d798e3114b55e872871aa08febf07727011/config/samples/nlb-internal-service.yaml#L1-L30