kubernetes / client-go

Go client for Kubernetes.
Apache License 2.0
8.99k stars 2.94k forks source link

Question about polling and alternatives #1309

Closed joyantamishu closed 6 months ago

joyantamishu commented 11 months ago

Hello All,

I am referring this code and line https://github.com/kubernetes/kubernetes/blob/master/test/integration/events/events_test.go#L76

First I would like to thank to author for adding this example. This piece of code is really helpful to develop more complicated solution based on k8s go-client. But I have few questions, which arises when we go for the more complicated event posting mechanism.

So, why polling? In a limited resource environment, when we try to send multiple events, and poll for every request, the static value 100 and 20 might not be effective, considering the load on api-server. Persistence of the sent event might take longer. Now we can argue some 99 percentile would follow this pattern, but that is not the answer. This is non-deterministic and theoretically the timeout can exceed whatever the value we set. So my question is, Can we somehow modify the example so that instead of polling, some interrupt based mechanism would notify the caller that event has been handled to api-server for processing. I am not familiar with the go-client code that much, so I am not sure if there is any existing method/packages in go-client that can perform this for me.

Thanks in advance.

k8s-triage-robot commented 8 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 7 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 6 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 6 months ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes/client-go/issues/1309#issuecomment-2028468494): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.