<p>I have a kubernetes cluster with several nodes, and it is connecting to a SQL server outside of the cluster. How can I whitelist these (potentially changing) nodes on the SQL server firewall, without having to whitelist each Node's external IP independently?</p>
<p>Is there a clean solution for this? Perhaps some intra-cluster tooling to route all requests through a single node?</p>

Papi Abi
<p>You would have to use a NAT. It is possible, but fiddly (we do this weekly in order to connect to a hosted service to make backups, and the hosted service only whitelists a specific IP.)</p>
<p>We used Terraform for spinning up a cluster, then deploying our backup job to it so it could connect to the hosted service, and since it was going via the NAT IP, the remote host would allow the connection.</p>
<p>We used Cloud NAT via Terraform (as we were on GKE): <a href="https://registry.terraform.io/modules/terraform-google-modules/cloud-nat/google/latest" rel="nofollow noreferrer">https://registry.terraform.io/modules/terraform-google-modules/cloud-nat/google/latest</a></p>
<p>Though there are surely similar options for whichever Kubernetes provider you are using. If you are running bare-metal, you'll need to do the routing yourself.</p>
