I have one public GKE cluster with 2 nodes and with that, 2 public external IPs. I want only one egress IP.
I want to use Cloud NAT for that. It seems it is possible.
An alias IP range assigned to the VM's network interface: Even if the network interface has an external IP address assigned to it, you can configure a Cloud NAT gateway to provide NAT for packets whose sources come from an alias IP range of the interface. An external IP address on an interface never performs one-to-one NAT for alias IP addresses.
I created a Cloud NAT but it is not working. I use the following commands to get the IP and it always returns one of the IPs of the nodes.
kubectl run -i --tty get-ip-address --image=dwdraju/alpine-curl-jq --restart=Never
and
curl checkip.amazonaws.com
My cluster has VPC native enabled.