<p>I have noticed something strange with my service deployed on GKE and I would like to understand...</p>
<p>When I Launch <code>kubectl get services</code> I can see my service EXTRNAL-IP. Let's say <code>35.189.192.88</code>. That's the one I use to access my application.</p>
<p>Ben when my application tries to access another external API, the owner of the API sees another IP address from me : <code>35.205.57.21</code></p>
<p>Can you explain me why ? And is it possible to make this second IP static ?</p>
<p>Because my app has to access an external API, and the owner of this API filters its access by IP address</p>
<p>Thanks !</p>

Frederic Collin
<p>The IP address you have on service as EXTERNAL-IP is a load balancer IP address reserved and assigned to your new service and it is only for incoming traffic.</p>
<p>But when your pod is trying to reach any service outside the cluster two scenarios can happen:</p>
<ol>
<li>The destination API is inside the same VPC, which means that no translation of IP addresses is needed and then on the last version of Kubernetes you will reach the API using the Pod IP address assigned by Kubernetes on the range <code>10.0.0.0/8</code>.</li>
<li>When the target is outside the VPC you need to reach it using some kind of NAT, in that case, the default gateway for your VPC is used and the NAT applies the IP address of the node where the pod is running.</li>
</ol>
<p>If you need to have and static IP address in order to whitelist it you need to use a cloud NAT</p>
<p><a href="https://cloud.google.com/nat/docs/overview" rel="nofollow noreferrer">https://cloud.google.com/nat/docs/overview</a></p>
