Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid unnecessary headless endpoint mirrors cleanups during GC (l…
…inkerd#12500) Subject Fixes a bug where headless endpoint mirrors get cleaned up during GC Problem When GC is triggered (which also happens at startup or when the link watch disconnects), the service mirror controller attempts to look for services that can be GC'ed. This is done by looping through the local mirrored services on the cluster, then extracting the name of the original service in the remote (by dropping the target name suffix). However, this check doesn't account for the headless endpoint service mirrors (the per pod cluster IP services). For example, if you have nginx-svc in the west cluster and two replicas, the source cluster will end up with nginx-svc-west, nginx-set-0-west and nginx-set-1-west. The logic would then parse the resource name for the latter two services as nginx-set-0 and nginx-set-1 which won't exist on the remote and ends up deleting them as part of GC. The next sync would recreate those mirrors but you end up with downtime. Solution For those cases, instead of parsing the remote resource from the local service name, retrieve the info from the `mirror.linkerd.io/headless-mirror-svc-name` label. Validation Unit tests Fixes linkerd#12499 Signed-off-by: Marwan Ahmed <me@marwanad.com> Signed-off-by: Mark S <the@wondersmith.dev>
- Loading branch information