title: AKS: IP whitelisting (ingress)
body: <p>I am trying to whitelist IP(s) on the ingress in the AKS. I am currently using the <code>ingress-nginx</code> not installed with Helm. </p>
  
  <p>The mandatory kubernetes resources  can be found <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml" rel="nofollow noreferrer">here</a> </p>
  
  <p>The service is started as:</p>
  
  <pre><code>spec:
    externalTrafficPolicy: Local
  </code></pre>
  
  <p>Full yaml <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/cloud-generic.yaml" rel="nofollow noreferrer">here</a></p>
  
  <p>My ingress definition is:</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    name: example-ingress
    # namespace: ingress-nginx
    annotations:
      ingress.kubernetes.io/rewrite-target: /
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
      nginx.ingress.kubernetes.io/whitelist-source-range: "xxx.xxx.xxx.xxx"
  spec:
    rules:
    - http:
        paths:
        - path: /xx-xx
          backend:
            serviceName: xx-xx
            servicePort: 8080
        - path: /xx
          backend:
            serviceName: /xx
            servicePort: 5432
  </code></pre>
  
  <p>The IP whitelisting is not enforced. Am I doing something wrong ?</p>