Source IP Whitelist Kubernetes ingress GCE

2/21/2017

Is there anyway to filter on source-ip on the kubernetes ingress in GCE? I have tried the ingress.kubernetes.io/whitelist-source-range: but doesnt seems to be working in GCE.

-- Kristian Petersen
google-kubernetes-engine
kubernetes

1 Answer

2/22/2017

I guess You are trying to use this feature with GCE native controller instead NGINX? This works with NGINX only at the moment.

NGINX Controller configuration: https://github.com/kubernetes/ingress/blob/master/controllers/nginx/configuration.md

Example configuration of ingress :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: whitelist
  annotations:
    ingress.kubernetes.io/whitelist-source-range: "1.1.1.1/24"
spec:
  rules:
  - host: whitelist.test.net
  http:
    paths:
    - path: /
    backend:
      serviceName: webserver
      servicePort: 80
-- Evaldas
Source: StackOverflow