# GKE + Cloud NAT without private cluster

**URL:** <https://discuss.kubernetes.io/t/gke-cloud-nat-without-private-cluster/6806>\
**Category:** General Discussions\
**Created:** [June 17, 2019, 2:37pm UTC](https://discuss.kubernetes.io/t/gke-cloud-nat-without-private-cluster/6806 "2019-06-17T14:37:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ugo\_Reynaldi](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/ugo_reynaldi/32/3152_2.png) [@Ugo\_Reynaldi](https://discuss.kubernetes.io/u/Ugo_Reynaldi)\
**Post date:** [June 17, 2019, 2:37pm UTC](https://discuss.kubernetes.io/t/gke-cloud-nat-without-private-cluster/6806/1 "2019-06-17T14:37:56Z")

</div>

Hi all, i was trying to use Cloud NAT to get a stable egress IP for the outbound connections from my pods.

The cluster is not a private cluster but a standard cluster on the default VPC network but from the official docs look like is possible to nat the pods traffic

> Regular (non-private) GKE clusters assign each node an external IP address, so such clusters cannot use Cloud NAT to send packets from the node’s primary interface. Pods can still use Cloud NAT if they send packets with source IP addresses set to the pod IP. ( [Cloud NAT overview &nbsp;|&nbsp; Google Cloud Documentation](https://cloud.google.com/nat/docs/overview) )

So i gave it a try but the pod egress traffic is not captured by Cloud NAT.  
I was thinking that maybe this happend because k8s masquerade the pod ips by default. So i was thinking to enable the network policy on k8s then add a custom masquerade policy to disable the masquerading on the pod net ips:

nonMasqueradeCIDRs:

- 10.44.0.0/14  
resyncInterval: 60s

> **[Configuring an IP masquerade agent in Standard clusters  |  GKE...](https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent#config_agent_configmap)**

In not sure that this will work, any advice or alternative idea to get a stable ip for egress connections?

Thank you

### Cluster information:

Kubernetes version: 1.11.8-gke.6  
Cloud being used: GKE  
Installation method:  
Host OS:  
CNI and version:  
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

–!\>

---

<div class="post-metadata">

**Author:** ![Denis\_Semenov](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/denis_semenov/32/4040_2.png) [@Denis\_Semenov](https://discuss.kubernetes.io/u/Denis_Semenov)\
**Post date:** [November 10, 2019, 9:18pm UTC](https://discuss.kubernetes.io/t/gke-cloud-nat-without-private-cluster/6806/2 "2019-11-10T21:18:15Z")

</div>

Hi, there. I’ve stuck in the same situation. Could you please share any updates on your effort to make it work?

---

<div class="post-metadata">

**Author:** ![Ugo\_Reynaldi](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/ugo_reynaldi/32/3152_2.png) [@Ugo\_Reynaldi](https://discuss.kubernetes.io/u/Ugo_Reynaldi)\
**Post date:** [November 13, 2019, 8:18am UTC](https://discuss.kubernetes.io/t/gke-cloud-nat-without-private-cluster/6806/3 "2019-11-13T08:18:14Z")

</div>

Hi, i didn’t solve it. I mean, i had a strict schedule so we changed the beahaviour of our app to allow the multi ip egress because the Cloud Nat would not capture the traffic and custom solutions didn’t grant us stability.
