<p>I setup a cluster on gke. </p>

<p>I also have an RDS database on AWS, this one is inside a VPC. I need to whitelist a CIDR range for access to the database from GKE.</p>

<p>My problem is, all my nodes on gke have a specific IP but not in the same range.</p>

<p>So my question is, how can I have a unique IP outside(NAT) or define a range for the allocation of ip on my node?</p>

<p>I have tried <a href="https://medium.com/google-cloud/using-cloud-nat-with-gke-cluster-c82364546d9e" rel="nofollow noreferrer">this solution</a>, but it does not seem to be working, <code>curl checkip.amazonaws.com</code> returns the IP of my node, maybe I forgot some things...</p>

<p>Thanks in advance.</p>

Alexandre Cys
<p>Using <a href="https://cloud.google.com/nat/docs/overview" rel="nofollow noreferrer">Cloud NAT</a> is definitely the way to go. It sounds like it you've tried this and it isn't working, but without NAT (as you've found) you won't have an easy way to provide a CIDR range (or even a stable set of IPs) to RDS. IPs for VMs come from a very wide range and if you scale your cluster up you will get new IPs that won't be in the same range as your existing IPs. Cloud NAT allows you to have a stable range from which all of your cluster traffic egresses, and you can use that for authentication to RDS. </p>
