Skip to content
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

reconcile, Filter daemon-sets and deployments to controlled namespace #978

Closed
wants to merge 1 commit into from

Conversation

oshoval
Copy link
Collaborator

@oshoval oshoval commented Aug 23, 2021

In order to save compute/network resources, filter the watch
CNAO does on the deployments and daemonset to watch only
CNAO operator namespace.

Signed-off-by: Or Shoval oshoval@redhat.com

None

In order to save compute/network resources, filter the watch
CNAO does on the deployments and daemonset to watch only
CNAO operator namespace.

Signed-off-by: Or Shoval <oshoval@redhat.com>
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Aug 23, 2021
@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign qinqon after the PR has been reviewed.
You can assign the PR to them by writing /assign @qinqon in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sonarcloud
Copy link

sonarcloud bot commented Aug 23, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@oshoval
Copy link
Collaborator Author

oshoval commented Aug 23, 2021

/cc @RamLavi @phoracek

@@ -131,7 +131,7 @@ func add(mgr manager.Manager, r *ReconcileNetworkAddonsConfig) error {
// Create custom predicate for NetworkAddonsConfig watcher. This makes sure that Status field
// updates will not trigger reconciling of the object. Reconciliation is trigger only if
// Spec fields differ.
pred := predicate.Funcs{
crPred := predicate.Funcs{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Predicates are filtering on the client level, we are still getting all the Pods streamed from the API server.

We should either register the cache to only watch a specific namespace using https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/manager/manager.go#L188. But with this I'm not sure whether we can limit only part of the operator.

If the option above is not possible, we may want to use new Quique's option to filter on cache: kubernetes-sigs/controller-runtime#1435

Copy link
Collaborator Author

@oshoval oshoval Aug 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried the first option #981
the only tests that are failing are the ones that deploy nmstate on different namespace (nmstate ns) because it can't find them,
its a no go then ?
or its safe to require that no other component is installed ?
https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_cluster-network-addons-operator/981/pull-e2e-cluster-network-addons-operator-workflow-k8s/1429820891172179968

there is also this failure but i don't think its related
https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_cluster-network-addons-operator/981/pull-e2e-cluster-network-addons-operator-nmstate-functests/1429820891654524928

maybe we can change the namespace of the external nmstate to be in the real namespace ? or its not good

if we don't want this approach we need to bump controller-runtime and check the 2nd approach,
there as well we would need to filter according all the app labels of the components that we want to watch, because we can't predict the namespaces where it will be deployed

@oshoval
Copy link
Collaborator Author

oshoval commented Aug 25, 2021

closing as this is client side, and we want server side filtering of just cnao components, even on external namespaces (using labels most likley with Quique method, but didn't try yet)

first controller runtime is needed

see #978 (comment)

@oshoval oshoval closed this Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note-none Denotes a PR that doesn't merit a release note. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants