-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support watch multiple namespaces matched witch namespace selector #7472
Support watch multiple namespaces matched witch namespace selector #7472
Conversation
@zryfish: This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Welcome @zryfish! |
Hi @zryfish. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
6802d0e
to
43b30b0
Compare
5872057
to
a4d782c
Compare
/kind feature |
/ok-to-test For v1.0.1 |
resyncPeriod time.Duration, | ||
client clientset.Interface, | ||
updateCh *channels.RingChannel, | ||
disableCatchAll bool, | ||
icConfig *ingressclass.IngressClassConfiguration) Storer { | ||
|
||
namespaceSelector, _ := labels.Parse(watchNamespaceSelector) |
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.
I would probably complain here about ignoring the error (even if you do that earlier, in the main.go).
I think we already waited too much for this change (sorry, been busy with a lot of stuff), but I'm here thinking if we cannot change the new function to receive a labels.Selector (change the nginx.Configuration structure) so we can "skip" this here.
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.
Yeah, good suggestion, changed as suggested
@@ -315,6 +329,35 @@ func New( | |||
store.informers.Service = infFactory.Core().V1().Services().Informer() | |||
store.listers.Service.Store = store.informers.Service.GetStore() | |||
|
|||
// avoid caching namespaces at cluster scope when watching single namespace |
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.
👏 👏
@zryfish overall it looks really good to me, thanks! I have left one concern about the helm vs defaults (probably my mess) and some small nits/typos to be fixed. Targeting to release a new version on tuesday, 12 (holiday here, will have some time), if we can ship this until there it would be great. Thanks |
3d1fd03
to
cf0e5ed
Compare
@rikatz Typo should be fixed now. |
@zryfish I will cut v1.0.4 now and will for sure ship this in v1.0.5 :) Just want to make a final pass but need to solve an openssl bug here Thanks! |
cf0e5ed
to
6d548ae
Compare
@zryfish one last thing (promise!) now that I was doing a final pass:
On the handlers (inside the function) wouldn't be good to also limit the watch Namespace? This way you wouldn't populate the informers and caches with unnecessary stuff :) |
Yeah, I agree. But I think we already limit the namespace during initializing the informer factories if the
I couldn't think of a better way to limit namespaces when the namespace selector is specified because newly created namespaces could match with the namespace selector, we need to watch those namespaces too. Namespace selector is much like watching the cluster namespaces because the watching namespaces may change during execution, cluster level resources caching is needed. |
6d548ae
to
fd36b8c
Compare
skip caching namespaces at cluster scope if only watching single namespace add --watch-namespace-selector in user guide add e2e test
fd36b8c
to
0b20c7f
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rikatz, zryfish The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
skip caching namespaces at cluster scope if only watching single namespace add --watch-namespace-selector in user guide add e2e test
What this PR does / why we need it:
The watch-namespace flag only supports a single string namespace value or an empty value that maps to all namespaces.
This PR implements watching multiple namespaces with a labelSelector. There is an issue with more details #7090
Types of changes
Which issue/s this PR fixes
fixes #7090
How Has This Been Tested?
Checklist: