SharedIndexInformer events not detecting Terminating state of a pod
See original GitHub issueIs your enhancement related to a problem? Please describe
I need to detect when pod is entering “Terminating” state.
SharedInformerFactory factory = kubernetesClient.informers();
informer=factory.sharedIndexInformerFor(Pod.class, new OperationContext().withNamespace("ns"),10 * 1000L);
informer.addEventHandler(new ResourceEventHandler<Pod>() {...}
Delete event is triggered when pod is completely terminated, but I need when it begins the termination.
Describe the solution you’d like
n/a
Describe alternatives you’ve considered
No response
Additional context
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Pods stuck in Terminating status - kubernetes - Stack Overflow
If the pod is in a namespace other than default namespace then it is required to include -n <namespace-name> , otherwise above command...
Read more >How to Debug Kubernetes Pending Pods and Scheduling ...
Learn how to debug Pending pods that fail to get scheduled due to resource constraints, taints, affinity rules, and other reasons.
Read more >Introduction to Fabric8 Kubernetes Java Client Informer API
Informers use the Kubernetes API to learn about changes in the state of a Kubernetes ... SharedIndexInformer<Pod> podInformer = sharedInformerFactory.
Read more >Determine the Reason for Pod Failure - Kubernetes
The termination message is intended to be brief final status, such as an assertion failure message. The kubelet truncates messages that are ...
Read more >Release 4.8.12 - Release Status
Updating ose-aws-pod-identity-webhook images to be consistent with ART #141 ... Bug 1924728: Add warning events to vm status and changed appearance to be ......
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
See https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase - Terminating is not actually a phase:
So you’ll need to instead check for the metadata.deletionTimestamp as an indication that the pod is terminating.
You should check the pod status in onUpdate.