<p>I'm using GKE to manage my app and the app is trying to consume 3rd party API, and the 3rd party API is whitelisting ip addresses that trying to access their APIs, how can i find what ip address that my app used when consume 3rd party APIs?</p>

<p>The IP address used by the Pod depends on type of service and a few more factors, which are very well documented in <a href="https://kubernetes.io/docs/tutorials/services/source-ip/" rel="nofollow noreferrer">this documentation page</a></p>
<p>There is also IP Masquerade agent which allows you to use Node's IP address to talk to services on other nodes instead of IP of POD, <a href="https://kubernetes.io/docs/tasks/administer-cluster/ip-masq-agent/" rel="nofollow noreferrer">documented here</a></p>
<p>Now coming to solution to your actual problem, you will have to use a NAT Gateway tied to a static IP so that all the outgoing traffic from your cluster will use same IP - no matter which POD/Node it originates from. I found a few guide but YMMV based on which cloud or underlying infrastructure you are on</p>
<ul>
<li><a href="https://devopstales.github.io/cloud/gke-egress/" rel="nofollow noreferrer">GKE and NAT for IP Masking</a></li>
<li><a href="https://docs.aws.amazon.com/eks/latest/userguide/external-snat.html" rel="nofollow noreferrer">AWS Guide for same</a></li>
</ul>
<p>You should search for &quot;Kubernetes IP Masquerade NAT &quot; for instructions specific to your cloud!</p>
