Search code examples
kuberneteskubernetes-pod

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


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?


Solution

  • 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.