<p>I have an application running inside in the kubernetes cluster where I am making an API call to an endpoint lets say <code>www.example.com/api</code> which another team maintains, but the request is timing out.
I discovered that the IPs needs to be whitelisted in order to make a successful request to that endpoint and we whitelisted the cluster IP .
Also at this point, we did not whitelist the node IPs that I got by running
<code> kubectl get nodes -o wide</code> . Any pointers will be very helpful.</p>

Jainam Shah
<p>If you whitelisted the Control plane IP, it's useless, it's not the control plane that perform the API call, but your code running in the Pods.</p>
<p>And the pods run on your nodes. The problem is: if your cluster can scale automatically the number of Node, you don't know in advance the IPs that you will have.</p>
<p>(It's also for that reason that Google says not to trust the network (the IP) but the identity (the authentication that you can provide with your API Call)).</p>
<hr />
<p>Anyway, one recommended and secure way to secure and solve your issue is to create a cluster with private node (no public IPs) and to add a Cloud NAT to nat the external calls into a static (and owned) Public IP(s).</p>
<p>Because it's YOUR IP(s) you can turst and allow them (no reuse possible by another Google Cloud customer because it reuse an IP in the Google pool, that you used before).</p>
<p>You can find a sample <a href="https://cloud.google.com/nat/docs/gke-example" rel="nofollow noreferrer">here</a></p>
