How to setup /var/log/container in kubernetes single node cluster with kubeadm

11/6/2019

I've installed a single node cluster with kubeadm but the log symlink on /var/log/containers is empty. What I need to do to configure it?

-- Manuel Castro
kubernetes
kubernetes-pod

1 Answer

11/7/2019

On machines with systemd, the kubelet and container runtime write to journald. Check if your log output runs to journald. By defoult it should write those logs to json.log files but I don't know any specifics of your setup. Check /etc/sysconfig/ for --log-driver=journald and delete it if needed. What we want here is to have the log driver set to json. Therefore you would see the logs files in /var/log/containers.

Please let me know if that helped.

-- OhHiMark
Source: StackOverflow