Comments (10)
Hi @AllenZMC!
When you say retrieve
what do you mean? when do you retrieve objects with kooper?, the object that you receive from kooper on each reconciliation loop iteration, is retrieved from the cache, and these objects are only updated when changes happen (that's the watcher purpose), the lister is used on start to get the initial full list of objects.
from kooper.
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)
Because getting resources such as pods or configmap from the cache is faster, which can reduce the pressure of etcd.
configMap, err := p.kubeClient.CoreV1().ConfigMaps(namespace).Get(name, metav1.GetOptions{})
from kooper.
Where is that line?
from kooper.
This code is in spotahome/redis-operator
from kooper.
I hope to quickly access the k8s resources such as pod, configmap, etc. in the operator.
from kooper.
Obtaining k8s resources such as pods and configmaps from the cache is faster than directly accessing etcd
from kooper.
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 RedisFailover
CRDs, if the iteration logic needs to access to different resources (Redis commands, other Kubernetes resources, database access...) is part of the app, and is out of the scope of Kooper and the responsibility is on the app implementation.
from kooper.
OK, thanks.
from kooper.
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 pods
, and when handling each pod log it access an ingress
, Kooper cache will not have ingresses
. So in case you could access the cache, the resources would not be stored there.
from kooper.
Can I close the issue? or do you have more questions regarding this (or maybe I didn't explain correctly
from kooper.
Related Issues (20)
- Dealing with deletion HOT 3
- Code examples
- go mod fails HOT 1
- Get error when running the examples/config-custom-controller HOT 1
- update client-go version HOT 2
- update client-go version to support 1.22 in kooper 0.8 HOT 6
- support go-client 0.24.2
- Allow short names on CRD registration HOT 1
- Add leader election for operator HOT 3
- Handler gets all the old events on controller refresh HOT 4
- Question: Operator-framework HOT 4
- Allow requeuing events for the primary resource HOT 1
- Possible to get object for DeleteFunc ? HOT 2
- Expose columns for kubectl HOT 4
- Namespace Is Empty In the Handler HOT 5
- Unable to pass controller name to the controller.NewSequential #bugVSfeature HOT 2
- [help] crd.NewClient require clientset.Interface with Apiextensions HOT 4
- Question: Leader election vs Deployment HOT 3
- Are 1.14. supported HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kooper.