Why Argo event is always in state Pending? - argo-workflows

I've followed example here https://argoproj.github.io/argo-events/sensors/triggers/argo-workflow/ in minikube and after curl post i just get events in state pending with argo list -n argo-events. Could someone please point me what might be the problem about it?

Related

Is it possible to find out resource update time from kubemaster?

We can see updates to deployment using command:
kubectl rollout history deploy/<name>
We can also see updated config using:
kubectl rollout history --revision=<revision-#> deploy/<name>
I'm not sure how to find out given revision's update time. Is it possible to find it?
If you are storing events from the namespace or api server logs, you might be able to find out. One crude way will be to look at creation time for replica sets of the deployment - kubectl get replicaset

How to get status history/lineage for Kubernetes pods

I was wondering if there is a kubectl command to quickly get the history of all STATUS for a given pod?
for example: Lets say a pod - my-test-pod went from ContainerCreating to Running to OomKill to Terminating:
I was wondering if there is a command that experts use to get this lineage. Appreciate a nudge..
Using kubectl get events you can only see events of last 1 hour. If you want to persist events for a longer duration you can sue eventrouter.The event router serves as an active watcher of event resource in the kubernetes system, which takes those events and pushes them to a user specified sink. This is useful for a number of different purposes, but most notably long term behavioral analysis of your workloads running on your kubernetes cluster.
kubectl get events or kubectl describe pod which shows the events for the pod at the bottom. However events are only kept for a little while, so it's not a permanent history. For that you would need some webhooks or a tool like Prometheus.

How to know when a Service is created?

In kubernetes, you can listen for events using kubectl get events. This works for other resources, but I would like to know when a Service is created and destroyed.
When I run kubectl describe my-service I get Events: <none>.
How can I know when a service was created?
Every api object has a creation timestamp in the metadata section. Though that doesn’t tell when it is edited. For that you might want an audit webhook or something like Brigade.
When a service gets created, you should get the service listed when you run below command
Kubectl get svc

Kubectl get events says there are no resources

I am using Azure kubernetes service(managed servcie). kubectl get events -namespace abc says there are no resources.
I used get the events all the time, on the same cluster and suddenly it returns there are no resources. Can some one help out?
Remark: This is a cluster which is currently having lots of traffic and should have events.
Try deleting some pod, then check for
kubectl get events -w
in that namespace, you will get some events, so likely when you were checking, there was no event going on. Both the Control Plane components and the Kubelet emit events to the API server as they perform actions like pod creation, deletion, replica set creation, hpa etc
probably means there no events. Now I see only 1 event in kube-system namespace. You will most likely see some events in that namespace:
kubectl get events -n kube-system
which will confirm everything is fine.
Have a look at Timeline of kubernetes events. Events seem to be retained only a certain amount of time, so maybe there are no events in the particular namespace.
Also as 4c74356b41 suggest check kube-system ns you most probably will see events.
The 'namespace' parameter sould be prefixed with two hyphens. The right command is
kubectl get events --namespace abc
OR
kubectl get events -n abc
'kubectl get events' misleads by throwing an error message as "No resources found in default namespace." when the syntax of the command is wrong.

Kubernetes events for container activity on node

I have Kubernetes cluster with Kubernetes master and nodes. I am interested in listening to the event on Kubernetes master when any node creates/stops container.
Something similar docker events which keeps on listening for the events and pops the output on the screen on some activity.
Can someone please let me know how I can do this for Kubernetes?
You might want to dive deep into the API docs and check the actual documentation.
In order to see all events, you can watch one of the objects of interests and maybe filter down the list so that you don't see everything. How that's done is described in the API operations guide.
A first super simple try would be: http://<kubernetes-master>:8080/api/v1/pods?watch=true to see the stream of events for the v1.Pod objects.
Another way to discover the API is to use kubectl in verbose mode. So if you found a kubectl command which get's you what you need you could add -v=6 to it to see which API url is called to get the data. In your program you can then use the same URL to get your data without kubectl in the middle.
Using the example from Janos this would be: kubectl get ev -w -v=6 which results in sth like:
...
I0322 17:03:55.738391 18068 round_trippers.go:318] GET http://127.0.0.1:8080/api/v1/watch/namespaces/default/events?resourceVersion=18474970 200 OK in 0 milliseconds
...
Hope any of this helps.