<p>I am setting an IP whitelist in my kubernetes ingress config via the annotation <code>ingress.kubernetes.io/whitelist-source-range</code>. But, I have different whitelists to apply for different environments (<code>dev</code>, <code>staging</code>, <code>production</code>, etc.) Therefore, I have a placeholder variable in my <code>deploy.yaml</code> that I find/replace with the appropriate IP whitelist based on the environment.</p>

<p>At the moment, for dev, I am passing an empty string as the whitelist because it should be able to receive traffic from all IPs, which currently works as intended. But, logs in <code>nginx-ingress-controller</code> complain about the following:</p>

<pre><code>error reading Whitelist annotation in Ingress default/{service}: the 
annotation does not contain a valid IP address or network: invalid CIDR 
address:
</code></pre>

<p>How do I set a proper <code>whitelist-source-range</code> to allow all IPs but not create noisy error logs like the one above?</p>

Jayant Sani
<p>Yes, it will give you error reading according to the <a href="https://github.com/kubernetes/ingress-nginx/blob/master/internal/ingress/annotations/ipwhitelist/main_test.go" rel="nofollow noreferrer">ingress annotations ip whitelist</a>.
It suspecting a IP range or Multiple IP ranges, even you didn't put a value, you will get the reading error as well, to get ride of this error and allow all the IPs put 0.0.0.0/0 this will bypass and fix your issue.</p>
