Hi I'm trying to setup basic logging to get all my pod logs at a single place. Following is the pod-spec I have created but couldn't find the trace of the logs in the location mentioned. What could be missing in the template below?
apiVersion: v1
kind: Pod
metadata:
name: counter
spec:
containers:
- name: count
image: busybox
args: [/bin/sh, -c,
'i=0; while true; do echo "$i: $(date)" >> /u01/kubernetes_prac/logs/log_output.txt; i=$((i+1)); sleep 1; done']
volumeMounts:
- name: varlog
mountPath: /u01/kubernetes_prac/logs
volumes:
- name: varlog
emptyDir: {}
Look into fluentd , to save ur logs somewhere(s3, elastic etc)
try this:
volumes:
- name: varlog
hostPath:
path: /tmp/logs
and check the node logs on that location