<p>I have installed the nginx ingress controller on GKE from 
<a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx</a> via helm chart</p>

<p>it does create the controller and also an firewall rule. The rule is open for all public ips. 
Is there a way to restrict this via the helm chart ? </p>

<p>if not any way go get the auto generated firewall rule via terraform and adjust ? 
the name of the firewall rule looks like this: k8s-fw-a8301409696934895b9facd9232892dc</p>

<p>Thanks </p>

<p>nginx ingress creates a loadBalancer service to expose it on GKE. You can define the <code>spec.loadBalancerSourceRanges</code> field in the service definition with the IPs you would like to allow access, all other IPs will be filtered. The default value for this field is 0.0.0.0 and the GCE firewall rules are created based on this field.</p>

<p>Note that you can also leverage the Nginx ingress controller to limit which IPs can connect, however, this still allows alls traffic to reach the node.</p>
