istio: Envoy/C-Ares bug can cause istio to become "stuck" to one DNS pod

Is this the right place to submit this?

  • This is not a security vulnerability or a crashing bug
  • This is not a question about how to use Istio

Bug Description

This is half bug report and half feature request. I’ve been unable to find any current configuration options to prevent this.

Due to the way c-ares and envoy do UDP DNS requests, there are cases in which an envoy pod will bypass the kube-dns service and send all requests to a single pod. Unfortunately, the way this manifests is that many if not all istio pods running envoy get pinned to the same service. We’ve seen this start happening in some of our larger clusters with many istio ingress gateways and sidecar proxies (with ISTIO_META_DNS_CAPTURE set to true).

c-ares and envoy have exposed a udp_max_queries configuration option to prevent too many requests going into a single connection. The feature request here is to either set this to a sane value or expose it to be configured by end users. Any other suggestion to prevent this issue would also be welcomed.

Version

This affects all istio versions

Additional Information

The screen shot below shows this manifesting in our cluster, you can see nearly all requests routed to a single DNS pod and the traffic to all other CoreDNS pods drop to near zero. Screenshot 2024-10-15 at 3 14 12 PM

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 29 (23 by maintainers)

Commits related to this issue

Most upvoted comments

You can read more info here: https://github.com/envoyproxy/envoy/issues/7965

But high level, if a UDP destination behind a kube service has a high enough latency, an envoy proxy can get ‘stuck’ to bypassing the normal routing (iptables) and send all requests to that one pod.

Since the istio sidecar is based on envoy, all sidecars could hit this bug as the latency increases and therefore quickly you could have all DNS requests going to a single pod.

@JingmingGuo I don’t super understand the problem, but I’ll try to summarize it so preface everything I’m about to say with “I think”. One envoy gets stuck to a coredns pod causing the coredns pod to be really slow. As the other envoys cycle through coredns pods, they will eventually hit the slow one and themselves get stuck on it. Eventually all envoys are stuck on that pod.

@rjbez17 @howardjohn If we are unsure, I think we should have this be a configurable value, but leave it unlimited connections by default.

edit: or whatever the default behavior is