telepresenceio / telepresence

Local development against a remote Kubernetes or OpenShift cluster
https://www.telepresence.io
Other
6.53k stars 513 forks source link

Prevent all updates to telepresence-agents configmap from the injector. #3632

Closed thallgren closed 3 months ago

thallgren commented 3 months ago

Updates to the telepresence-agents configmap may well trigger a roll-out of the corresponding workload. That roll-out will trigger new calls to the injector. If the API is fast enough, this will result in a loop that is similar to a recursion. The result is a large number of created pods that eventually must be deleted.

This PR removes the update of the configmap from the injector so that this loop is prevented.

This PR also add the needed watchers and event handlers that take care of the special telepresence.getambassador.io/inject-traffic-agent annotation, and ensure that the traffic-agent is injected or removed in accordance with its setting.

Integration tests that uses 25 service/deployment combos with the annotation enabled was added to ensure correct behavior for the traffic-manager for the cases when the traffic-manager is installed before the deployments or installed/updated when they were already present.