title: GCP internal load balancer
body: <p>I'm trying access elasticsearch cluster on GKE from my project in GAE - flexible. Since I don't want an external load-balancer, I'm following this guide:
  <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing</a>
  Both GKE and GAE are deployed in the same region, but the calls to the elasticsearch cluster timeout all the time. Has anyone done this and can share some tips would be much appreciated!</p>
  <p>My <code>service.yaml</code> file looks like this:</p>
  <pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
  kind: Service
  metadata:
    name: internalloadbalancerservice
    annotations:
      cloud.google.com/load-balancer-type: &quot;Internal&quot;
    labels:
      app.kubernetes.io/component: elasticsearch-server
      app.kubernetes.io/name: elasticsearch  #label selector service
  spec:
    type: LoadBalancer
    loadBalancerSourceRanges:   # restrict access
    - xxxxxxxx
    ports:
    - name: myport
      port: 9000
      protocol: TCP # default; can also specify UDP
    selector:
      app.kubernetes.io/name : elasticsearch # label selector for Pods
      app.kubernetes.io/component: elasticsearch-server
  </code></pre>