<p>I have the following setup:
  k8s cluster A, containing service SA
  k8s cluster B, containing service SB, and an HTTP ingress that routes traffic to SB</p>

<p>Is it possible to add service SA as the backend service for one of the path of the ingress? If so, how do I refer to it in the ingress configuration file? (using selectors in the usual way doesn't work, presumably because we are in different clusters)</p>

<p>Ingress objects help configure HTTP(S) load balancing for a single cluster. They don't have a concept of multiple clusters, so they aren't going to have a configuration language for what you are trying to accomplish (maybe they will with <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/federation.md" rel="noreferrer">Ubernetes</a>, but they certainly don't today).</p>

<p>The upshot is that you can bypass the Ingress configuration and configure the routing manually (after all, Ingress is really just an ease-of-use shortcut for a typical L7 configuration). You can create your own L7 configuration in GCP and set up the path based forwarding to route to different backend groups. You can then assign the backend groups to a <code>NodePort</code> service that you configure in each of your clusters. </p>

<p>The rough steps are:</p>

<ol>
<li>Create a <code>NodePort</code> service in each cluster</li>
<li>Create an HTTP health check for each service</li>
<li>Add a firewall rule to allow http health checks to hit your backends</li>
<li>Add a service to the instance group for your cluster (e.g. <code>gcloud compute instance-groups managed set-named-ports ...</code>)</li>
<li>Add backend services for the load balancer (e.g. <code>gcloud compute backend-services create ...</code>)</li>
<li>Add a backend for your cluster to this backend service (e.g. <code>gcloud compute backend-services add-backend ...</code>)</li>
<li>Map that URL to your backend service (e.g. <code>gcloud compute url-maps create ...</code>)</li>
<li>Create a load balancing proxy for that backend service (e.g. <code>gcloud compute target-http-proxies create ...</code>)</li>
<li>Create a forwarding rule for that proxy (e.g. <code>gcloud compute forwarding-rules create ...</code>)</li>
</ol>
