Kubernetes log when pod migrated

4/27/2018

I'm using a couple different versions of kubernetes - 1.7, 1.8, and 1.9 - and I'd like to know what log message to look for to know when a pod has been migrated from one node to another.

-- s g
kubernetes

1 Answer

4/28/2018

One very easy way is to use the API through proxy.

For example:

  • Run kube proxy to use curl without authentication

kubectl proxy

  • List all events with a watch

curl -s 127.0.0.1:8001/api/v1/watch/events

That will generate some json output, and you may use a grep command or jq command to format this json output.

curl -s 127.0.0.1:8001/api/v1/watch/events | jq

-- Nicola Ben
Source: StackOverflow