chaoskube
chaoskube copied to clipboard
Pod termination timestamp
Hi,
We need to see when each pod is killed. But the timestamp is not printed. I would expect date + time near each terminated pod. How can we see it?
INFO[0000] terminating pod name=xxxxxxxxx namespace=my-namespace INFO[0060] terminating pod name=yyyyyyyyy namespace=my-namespace INFO[0121] terminating pod name=zzzzzzzzz namespace=my-namespace
This happens by default when you run it interactively on your local machine.
When you run it as a container in Kubernetes or via $ docker run quay.io/linki/chaoskube (without -t) you'll see the full timestamp.
If you want to run it locally you can switch to a different log formatter, e.g. $ go run main.go --log-format json will print logs in json which contain the full timestamp.
Alternatively you can detach from the tty, e.g. run it via $ true | go run main.go 2>&1 | cat (taken from https://superuser.com/questions/1430872/how-to-simulate-a-shell-without-tty)