NoctisHsu
5/21/2018 - 5:49 PM

K8S command.sh

#Show all logs from pod since 1hr ago

kubectl logs --since=1h {podName}

#Show all logs stream from pod
kubectl logs -f {podName}

# Show all logs from pod with timestamps
kubectl logs -f --timestamps=true {podName}

# Show all logs from pod written in the last hour
kubectl logs --since=1h --timestamps=true {podName}

# get pod info
kubectl get pod {podName}

# ssh to pod
kubectl exec -it {podName} sh