How do I know the list of all possible statuses and reasons in Kubernetes?
Right now, I'm working with Kubernetes events. Based on certain unusual events, I will be reacting to it. For example, if a pod is backed off or pending, will receive such events and get notified via Email (custom code). Necessary actions would be taken further for each such events.
I have to know the list of all possible status for a pod and node. That would help me to handle uncommon behaviours in my code. If possible, it would be good to know the list of possible Events' reasons also.
I'm using Fabric8 kubernetes-client as I found some issues with Java Kubernetes-client for handling events.
The way I searched through Google, couldn't get some results.
What you are looking for is this document on official Kubernetes repository, which describes list of reasons for each of container status. For Waiting container status it is possible to get one of following reason: CreateContainerError.
If you need to have a complete list of events in Kubernetes, you should take a look directly to the Kubernetes project on github. Here the link to the event.go file. Why this file don't have statuses like OOMKilled? I think because it's not a status. It's a reason for FAILED status.
Pending The Pod has been accepted by the Kubernetes system, but one or more of the Container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running The Pod has been bound to a node, and all of the Containers have been created.
To check the version, enter kubectl version . In this exercise you will use kubectl to fetch all of the Pods running in a cluster, and format the output to pull out the list of Containers for each. Fetch all Pods in all namespaces using kubectl get pods --all-namespaces
If you need to have a complete list of events
in Kubernetes, you should take a look directly to the Kubernetes
project on github.
Here the link to the event.go
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With