l7mp / stunner-gateway-operator

STUNner Kubernetes Gateway Operator
Apache License 2.0
15 stars 6 forks source link

Handle existing load balancer class #41

Closed iterion closed 1 year ago

iterion commented 1 year ago

We frequently see an error like the following:

"error": "cannot upsert service \"stunner/gateway\": Service \"gateway\" is invalid: spec.loadBalancerClass: Invalid value: \"null\": may not change once set"

We're using the AWS load balancer controller, which sets that field when the service is created and handles the creation of a load balancer for us.

I traced this down to how the service gets recreated each time. We have a cache of the current state of the service in the global store, so we can use this to get the current values. We need to then be careful about adding ports, but other than that the change is pretty straightforward.

rg0now commented 1 year ago

Duplicate of https://github.com/l7mp/stunner/issues/104

iterion commented 1 year ago

Sorry I missed the earlier bug report, thanks for referencing it.

I wanted to update that we built and tested this in dev and rolled it out to our production clusters. And, it's been working reliably without the error log. Happy to try to figure out a test for this if you think it'd be worthwhile.

rg0now commented 1 year ago

Thanks a lot for the PR, we truly appreciate it that you made the effort! Don't worry about the duplicate: unfortunately some issues get reported to the STUNner repo and some issues here, and it's somewhat difficult to keep track of what's going on.