<p>I have a Kubernetes cluster on Google Kubernetes Engine. I want to assign a static IP for all outgoing traffic of a cluster.</p>

<p>I already have reserved external IPs but I can't assign them to a cluster with the GCP console.</p>

<p>I found a solution to do it with the cli :
<a href="https://stackoverflow.com/questions/41133755/static-outgoing-ip-in-kubernetes">Static outgoing IP in Kubernetes</a></p>

<p>but it targets the VM and I will need to set it each time I deploy. So it's not targeting the cluster.</p>

<p>Can anybody provide any pointers? Thanks.</p>

raven8
<p>GKE currently doesn't have an option to create the cluster with all your nodes using a reserved public IP. All you get in advanced networking options is something like this:</p>

<p><a href="https://i.stack.imgur.com/Dj4P9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Dj4P9.png" alt="advanced network k8s"></a></p>

<p>You will have to use the <code>gcloud</code> API that you mentioned which should be easy to put in a script.</p>

<p>Or you can also use the UI by editing the instance(s) and going into 'Network Interfaces' like this:</p>

<p><a href="https://i.stack.imgur.com/ZevJe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZevJe.png" alt="network"></a></p>
