1. A method for processing data messages through an overlay network for a cluster of application instances operating on machines located across a plurality of datacenters, the method comprising: receiving a data message, from a first application instance of the cluster operating on a first machine in a first datacenter, destined to a second application instance of the cluster; when the second application instance operates on a machine in a different, second datacenter: encapsulating the data message according to an overlay network defined for the cluster of application instances; and forwarding the encapsulated data message to a publicly accessible machine of the second datacenter, wherein only a subset of the application instances operating in the second datacenter operate on publicly accessible machines; and when the second application instance operates on a machine in the first datacenter, forwarding the data message directly to the machine on which the second application instance operates.