-
Notifications
You must be signed in to change notification settings - Fork 49
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
When kooper operates K8S object resources, can it be retrieved from the cache instead? #76
Comments
Hi @AllenZMC! When you say |
Hi @slok . See the following code. Is the operation to get the configmap obtained from the cache or directly access k8s etcd? (I use kooper in my operator)
|
Where is that line? |
This code is in spotahome/redis-operator |
I hope to quickly access the k8s resources such as pod, configmap, etc. in the operator. |
Obtaining k8s resources such as pods and configmaps from the cache is faster than directly accessing etcd |
oh, I understand now what do you mean. That's business logic of the operator, not the operator framework itself, Kooper has nothing to do with that, Kooper maintains a reconciliation loop on specific resources, these resources are the ones that trigger the iteration handling of that resource changes, and this handling code is logic of the application (in this case the redis operator logic), so... the app should maintain it's own cache on the resources it wants. Imagine those other resources as regular resources of any kind, a database query, a query to AWS API, a query to K8s API... whatever, Kooper is out of that scope of these resources. Kooper caches the resources on what the reconciliation loop is based on, in this case, the |
OK, thanks. |
Apart from that, Kooper only retrieves the resources it is subscribed to, so it will only cache those ones, so if my operator is based on |
Can I close the issue? or do you have more questions regarding this (or maybe I didn't explain correctly 😞) |
When kooper operates K8S object resources, it can be retrieved from the cache instead of directly accessing k8s. This allows quick access to k8s objects.
The text was updated successfully, but these errors were encountered: