FLINK-15911 it is now possible to run Flink behind a NAT/with an unresolvable external address. However, due to FLINK-11127, the MetricFetcherImpl tries to connect to the TaskManagers instead of the other way around. If the TM is running behind a NAT, it would require to define an external port. At the moment, it is only possible to configure the external and bind port at the same time via metrics.internal.query-service.port. Hence, the external port always needs to be the same as the bind port if port forwarding should work.
I think in order to properly solve this problem we either solve
FLINK-11127 or we introduce a metrics.internal.query-service.bind-port option which allows to configure a bind port. With such an option, metrics.internal.query-service.port would become the external port.