-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[nginx-ingress-controller] Add cidr whitelist support #1144
Conversation
ping @bprashanth |
return nil, ErrMissingWhitelist | ||
} | ||
|
||
ipnet, err := sets.ParseIPNets(val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this handle a command seperated list of cidrs? if not suggest making it like a similar annotation we already have for service.type=lb: https://github.com/kubernetes/kubernetes.github.io/pull/632/files. In fact can we call the same: https://github.com/kubernetes/kubernetes/blob/dae5ac482861382e18b1e7b2943b1b7f333c6a2a/pkg/api/service/annotations.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes https://github.com/kubernetes/kubernetes/blob/master/pkg/util/net/sets/ipnet.go#L26
EDIT: thanks for the question about the list. Fixed and test added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you include that as a comment/in the doc somewhere and change the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the name?
which name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the annotation, to match what we already have in the l4 loadbalancer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's deprecated because it's turning into a field with the same name kubernetes/website#632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
5beb58d
to
c6d2f23
Compare
@aledbf would you also put in aliasing via configmap like I mentioned in the issue? And than an additional annotation on the ingres would reference these like These would then be added to the cidr whitelisting per ingres option. Otherwise if our corporate outbound ip changes I have to adjust all ingress configs and with aliases only one configmap property. If this is already on planning nothing said but did not see it in the commits and thus not completely fixes the issue. |
@sander-su already included https://github.com/kubernetes/contrib/pull/1144/files#diff-3a0f10ad1be4fb0972021177f2cb9e9aR236 |
@aledbf Then to validate something else, could be my misunderstanding. An ingress controller handeles ingresess from all namespaces, right? (seen this behaviour in 0.61) An ingres can only forward incomming traffic to the services of the ns it belongs to, although the controller could be in another ns. Furthermore, we need to specify which alias for which ingres. What are your thoughts? |
Yes
This is the default. You can specify one namespace to restrict where the controller should look for Ingress rules. |
Currently there's no way to express this with Ingress. I think you can have one controller for each environment, but even with that you need different ingress rules |
If I can restrict an ingress controller to a namespace for rules this would be suficient. Which setting restrict the controller to one (or multiple?) ns for its rules. Cannot find it easily. Think it would be good to name this in the documentation. |
And thanks for resolving the issue this quick ;) |
It's an argument Just in case only is possible to watch all the namespaces or one (no multiple)
Good point. I will add a section for this in #1130. |
One more, regarding the discussion on the issue. (And one for the docs) |
Yes. Please open an issue with your use case to use a different source |
Not needed. |
Load-balancer-source-ranges is a bit misleading though. I would interpreted it as i need to specify the range of my load balancer here. But I whitelist the ip of the traffic comming into the loadbalancer by using proxy protocol. |
I would interpret it as I need to specify the source range of my loadbalancer here. I don't particularly have a strong preference about including/leaving out the whitelist prefix. If it makes things that much clearer to a majority of users, we can do it. It might lead to confusion because people don't get how it ties in with loadbalancer-source-ranges upstream, but we can fix that with documentation hopefully. |
LGTM thanks |
[nginx-ingress-controller] Add cidr whitelist support
fixes #1141