Tuesday, April 12, 2022

[SOLVED] Kubectl logs always empty

Issue

Im running a K3s on multiple RPis which works fine except for showing logs. kubectl logs <pod-name> is always empty.

For testing, I'm running busybox:

apiVersion: v1
kind: Pod
metadata:
  name: example
spec:
  containers:
  - name: example
    image: busybox
    args: [/bin/sh, -c, 'while true; do echo $(date); sleep 1; done']

The pod is running, but still no logs. I'm suspecting log2ram, which I installed to not destroy my SD-Cards in the long run. However, I can't figure out, why this happens and how to fix this.


Solution

Just found out, that log2ram was full. Clearing the /var/logs folder on the hosting node resolved the problem



Answered By - Urr4
Answer Checked By - Senaida (WPSolving Volunteer)