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

redundant configmap patch operations #90

Closed
jdef opened this issue Mar 13, 2021 · 9 comments
Closed

redundant configmap patch operations #90

jdef opened this issue Mar 13, 2021 · 9 comments

Comments

@jdef
Copy link

jdef commented Mar 13, 2021

patch := map[string]interface{}{

there appears to be no check on the configmap annotations here, to only issue a PATCH to apiserver if the desired value is different than the current. i started investigating this because our OPA policies rarely change, yet I see PATCH requests constantly issued to apiserver. this appears to, perhaps, be part of the problem.

@tsandall
Copy link
Member

I suppose kube-mgmt could perform a bytes.Equal check on the configmap data. That said, what's the actual problem you're observing? Those updates are only sent when there's a watch even on the configmaps. Either something on the configmaps is changing or k8s is just firing spurious watch events...

@jdef
Copy link
Author

jdef commented Mar 15, 2021

"updates are only sent when there's a watch event..."

AFAICT there's a full resync that happens every minute:

time.Second*60,

.. which corresponds to the audit logs in my cluster; and the update is hitting the apiserver, even when there are no configmap changes.

@jdef
Copy link
Author

jdef commented Mar 15, 2021

from the cache API docs re: informers:

resyncPeriod: if non-zero, will re-list this often (you will get OnUpdate
  calls, even if nothing changed). Otherwise, re-list will be delayed as
  long as possible (until the upstream source closes the watch or times out,
  or you stop the controller).

@tsandall
Copy link
Member

ah, @jdef you're right...sorry, it's been a while since I've looked at this code.

Feel free to submit a patch if you like.

@jdef
Copy link
Author

jdef commented Mar 16, 2021 via email

@jdef
Copy link
Author

jdef commented Mar 16, 2021

/cc @pires

@jdef
Copy link
Author

jdef commented May 7, 2022 via email

@eshepelyuk
Copy link
Contributor

Was this resolved by a PR? If so, mind linking to it?

On Sat, May 7, 2022, 1:13 AM Ievgenii Shepeliuk @.> wrote: Closed #90 <#90>. — Reply to this email directly, view it on GitHub <#90 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR5KLG3A35A7NBXM3WCJJ3VIX3WXANCNFSM4ZEJIXHA . You are receiving this because you were mentioned.Message ID: @.>

The links are just above your comment.

@jdef
Copy link
Author

jdef commented May 7, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants