How to set kube-scheduler print log to file

11/30/2016

kubernetes's version is 1.2

I want to watch the scheduler's log. So how to set kube-scheduler's log print to a file?

The kube-scheduler's configuration is at this path: /etc/kubernetes/scheduler. And the global configuration is at this path: /etc/kubernetes/config. So we can see these notes:

# logging to stderr means we get it in the systemd journal
KUBE_LOGTOSTDERR="--logtostderr=true"

# journal message level, 0 is debug
KUBE_LOG_LEVEL="--v=0"
-- urey
kubernetes
scheduler

1 Answer

12/13/2016

Can you tail the contents of the service (if running in systemd): journalctl -u apiserver -f

Or if a container, find the container id of the scheduler, and tail with docker: docker logs -f

-- Steve Sloka
Source: StackOverflow