Peer availability tracking
Diameter Proxy (DPR) has a small additional container named endpoints_watcher. It does not participate in the Diameter communication itself. Instead, it reflects the operational state of Kubernetes-based Diameter peers that connect to DPR and notifies DPR about the changes.
On its own, DPR only sees the Diameter connection towards a peer. The connection may still look alive even though the peer on the other side is already terminated. In that case, DPR keeps the connection open and keeps trying to send messages into it until the Diameter watchdog or transport timeout detects the failure. In Kubernetes, however, this information is available in advance, based on the readiness of the peer's Endpoints. It reflects that the peer is about to become unavailable, for example, due to an upgrade, restart, or scale-down. The endpoints_watcher makes this information available to DPR by notifying it whenever a peer's readiness changes.
As a result, DPR can stop sending Diameter requests towards such peers as early as possible. The established connection is not terminated, so in-flight requests can still complete. Once Kubernetes considers the peer healthy again, the endpoints_watcher reactivates it in DPR, and the peer resumes receiving requests.
The most common use case for this mechanism is a graceful, hitless update of the Diameter agents where DPR forwards requests.
You can enable the endpoints_watcher with the following configuration option:
The endpoints_watcher runs as a sidecar container in the same pod as DPR. It watches the Kubernetes EndpointsOpens in a new tab objects that have the diameter-server label in the same namespace where it is deployed. Periodically, it reports each peer's readiness to DPR over DPR's HTTP API. The HTTP API has two operations:
Since events from the Kubernetes API can be missing, the endpoints_watcher also periodically re-reports the state of all watched endpoints to DPR. You can tune the resync interval and the retry behaviour of notifications to DPR using these configuration options:
You can also configure the Kubernetes resourcesOpens in a new tab for the endpoints_watcher container under resources.endpoints_watcher: