<p>I am running kubernetes (k8s) on top of Google Cloud Patform's Container Engine (GKE) and Load Balancers (GLB). I'd like to limit the access at a k8s ingress to an IP whitelist.</p>

<p>Is this something I can do in k8s or GLB directly, or will I need to run things via a proxy which does it for me?</p>

<p>The way to whitelist source IP's in nginx-ingress is using below annotation.</p>
<p><code>ingress.kubernetes.io/whitelist-source-range</code></p>
<p><strong>But unfortunately, Google Cloud Load Balancer does not have support for it, AFAIK.</strong></p>
<p>If you're using nginx ingress controller you can use it.</p>
<p>The value of the annotation can be comma separated CIDR ranges.</p>
<p>More on <a href="https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md#whitelist-source-range" rel="nofollow noreferrer">whitelist annotations</a>.</p>
<p><a href="https://issuetracker.google.com/issues/35904903" rel="nofollow noreferrer">Issue tracker</a> for progress on Google Cloud Load Balancer support for whitelisting source IP's.</p>
