In addition to EDS endpoint metadata, there is CDS cluster metadata. The UPSTREAM_METADATA variable (see #2179) should check both locations for metadata, preferring EDS metadata over CDS metadata when both have matching keys. See also discussion in envoyproxy/data-plane-api#335.
At a high level, this requires plumbing the CDS metadata through from the API (probably via Upstream::ClusterInfo and its implementation) and then modifying the formatter in router/header_formatter.cc.