Use SharedIndexInformer with CustomResource
See original GitHub issueHello,
I wrote the watching for CustomResource. At first, I used Watcher, but I got the error “Kubernetes too old resource version”. Then, I referred this thread https://stackoverflow.com/questions/61409596/kubernetes-too-old-resource-version to use SharedIndexInformer, but the method sharedIndexInformerForCustomResource() is deprecated in openshift-client 5.9.0. Can anyone show me an example to watching CustomResource event?
SharedInformerFactory sharedInformerFactory = openShiftClient.informers();
SharedIndexInformer<GenericKubernetesResource> podInformer = sharedInformerFactory.sharedIndexInformerForCustomResource(context, 30 * 1000L);
...
Thanks,
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
SharedIndexInformer for Custom resource stuck in "Start ...
This is a static function which has been written by me. The Virtual Machine Class has been autogenerated using the instructions from the...
Read more >java - SharedIndexInformer for Custom resource stuck in "Start ...
I am trying to create a SharedIndexInformer for a Kubevirt Virtual Machine Instance (custom resource ...
Read more >SharedInformerFactory (Fabric8 :: Kubernetes - javadoc.io
Constructs and returns a shared index informer with resync period specified for custom resources. <T extends CustomResource<?,?>,L extends io.fabric8.kubernetes ...
Read more >How to Create a Kubernetes Custom Controller Using client-go
One happens in SharedIndexInformer , the other one is in custom controller. 1. Reflector performs object (such as namespace, pod etc) ...
Read more >Introduction to Fabric8 Kubernetes Java Client Informer API
SharedIndexInformer <Job> jobInformer = client.batch().v1().jobs() ... In case you want to use Informer API for some CustomResource , you can do it in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, I should have included:
client.genericKubernetesResources(context)…inform
We don’t want to expose the OperationContext for direct usage. It also gets confusing in terms of keeping track of existing informers.
The answer is set resync to 0L. Thanks @rohanKanojia for your help.