Kubernetes-ingress: IP whitelist

Created on 13 Mar 2018  路  1Comment  路  Source: nginxinc/kubernetes-ingress

Is there a way to configure whitelist IP's? Does this controller supports for this feature?

Most helpful comment

@aprisniak it is possible to configure that using *-snippets annotations and configmap keys, which allow you to use native NGINX configuration. For example:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: cafe-ingress
  annotations:
     kubernetes.io/ingress.class: "nginx"
     nginx.org/server-snippets: "allow 192.168.1.3; deny all;"
...

See http://nginx.org/en/docs/http/ngx_http_access_module.html to learn more about allow/deny directives.

>All comments

@aprisniak it is possible to configure that using *-snippets annotations and configmap keys, which allow you to use native NGINX configuration. For example:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: cafe-ingress
  annotations:
     kubernetes.io/ingress.class: "nginx"
     nginx.org/server-snippets: "allow 192.168.1.3; deny all;"
...

See http://nginx.org/en/docs/http/ngx_http_access_module.html to learn more about allow/deny directives.

Was this page helpful?
0 / 5 - 0 ratings