Skip to content

Conversation

andmat900
Copy link
Contributor

Applicable Issues

Description of the Change

This change implements lazy K8S API calling for getting jobs/pods in internal/kubernetes/kubernetes.go.

Alternate Designs

Possible Drawbacks

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Signed-off-by: Andrei Matveyeu, [email protected]

Change-Id: I50815baeea52d0ff11bf85a1861c2d38cc0f3fd1
@andmat900 andmat900 requested a review from a team as a code owner September 12, 2025 10:33
@andmat900 andmat900 requested review from t-persson and fredjn and removed request for a team September 12, 2025 10:33
Change-Id: Ib6c0e5c8472a7d57ff99d2d3f8359a19a744d153
@t-persson
Copy link
Collaborator

Why not use the cache already in client-go?

https://pkg.go.dev/k8s.io/client-go/tools/cache

Change-Id: Icef3545f9fdbd19f1f5807f56a918858b739d100
@andmat900
Copy link
Contributor Author

Why not use the cache already in client-go?

https://pkg.go.dev/k8s.io/client-go/tools/cache

We've done some load testing and looked at the client-go cache. For now, we'd like to continue with the current implementation and file your suggestion as a future improvement.

The trade-off is simplicity vs event-driven/real-time implementation.

@t-persson
Copy link
Collaborator

Why not use the cache already in client-go?

https://pkg.go.dev/k8s.io/client-go/tools/cache

We've done some load testing and looked at the client-go cache. For now, we'd like to continue with the current implementation and file your suggestion as a future improvement.

The trade-off is simplicity vs event-driven/real-time implementation.

Looking at this example it feels more simple than running our own implementation, but I guess it wasnt performant enough (If I understood your comment correctly)?

https://github.com/Karthik-K-N/goCache/blob/main/main.go

Change-Id: Ie98a899881d7b88e1c146d480176ba3d87a60110
@andmat900
Copy link
Contributor Author

Why not use the cache already in client-go?
https://pkg.go.dev/k8s.io/client-go/tools/cache

We've done some load testing and looked at the client-go cache. For now, we'd like to continue with the current implementation and file your suggestion as a future improvement.
The trade-off is simplicity vs event-driven/real-time implementation.

Looking at this example it feels more simple than running our own implementation, but I guess it wasnt performant enough (If I understood your comment correctly)?

https://github.com/Karthik-K-N/goCache/blob/main/main.go

I was referring to the example from your first URL.

@t-persson
Copy link
Collaborator

Why not use the cache already in client-go?
https://pkg.go.dev/k8s.io/client-go/tools/cache

We've done some load testing and looked at the client-go cache. For now, we'd like to continue with the current implementation and file your suggestion as a future improvement.
The trade-off is simplicity vs event-driven/real-time implementation.

Looking at this example it feels more simple than running our own implementation, but I guess it wasnt performant enough (If I understood your comment correctly)?

https://github.com/Karthik-K-N/goCache/blob/main/main.go

I was referring to the example from your first URL.

Ah, I see. That was merely a link to the cache package in client-go.

@andmat900
Copy link
Contributor Author

The simplified implementation in commit dcaea5c did not work as expected: it would require additional mutexes. Without them there were OOMKilled errors. Reverting to the previous implementation.

Change-Id: I75bd122dd0467a05b791d5648b73fd7708baacdd
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

Successfully merging this pull request may close these issues.

2 participants