aws / aws-application-networking-k8s

A Kubernetes controller for Amazon VPC Lattice
https://www.gateway-api-controller.eks.aws.dev/
Apache License 2.0
157 stars 48 forks source link

Improve webhook Pod Readiness Gate logic using metadata #631

Open erikfuller opened 2 months ago

erikfuller commented 2 months ago

This PR https://github.com/aws/aws-application-networking-k8s/pull/629 adds logic to determine whether or not a pod requires the addition of a Lattice readiness gate. The logic is not as performant as it could be, as it requires looping through all services in the pod's namespace, then through all routes to see if they reference the service.

Instead, we may want to investigate options for adding metadata directly to the objects (e.g. via annotation or finalizer on a service) or adding new CRDs for tracking these relationships, similar to the TargetGroupBindingLIst used by the load balancer controller.