<p>I am deploying the sample bookshelf node app (<a href="https://cloud.google.com/nodejs/tutorials/bookshelf-on-container-engine" rel="nofollow noreferrer">https://cloud.google.com/nodejs/tutorials/bookshelf-on-container-engine</a>). This app does OAUTH2 callback. </p>

<p>My question is where do I get the IP Address of the Load Balancer and does it change every time I push a new docker image?
Can I specify a DNS Entry for the LB and use that to register in the Google Oauth2 callback. </p>

<pre><code>  "OAUTH2_CALLBACK": "http://&lt;service ip address&gt;/auth/google/callback",
</code></pre>

<p>Here is my service.yaml file</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: bookshelf-frontend
  labels:
    app: bookshelf
    tier: frontend
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: http-server
  selector:
    app: bookshelf
    tier: frontend
</code></pre>

<p>Thanks, </p>

<p>If you already have kubectl configured to access your cluster, you should be able to find the ip address of the service with:</p>

<pre><code>$ kubectl get services
</code></pre>

<p>A <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Service</a> is separate from actual <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployment</a>. The cluster-ip of the service will not change unless you make changes to the Service.</p>

<p>If you are accessing a service internally, you can specify the service name rather than cluster-ip address.</p>

<p>E.g,</p>

<pre><code>$ kubectl get services
NAME                      CLUSTER-IP     EXTERNAL-IP      PORT(S)                      AGE
elasticsearch             10.3.247.13    &lt;none&gt;           9200/TCP                     9d
</code></pre>

<p>A deployment config accessing this service:</p>

<pre><code>output {
    elasticsearch {
        hosts =&gt; "elasticsearch:9200"
    }
}
</code></pre>
