ilegolas
ilegolas

Reputation: 1013

Automatic restart of a Kubernetes pod

I have a Kubernetes cluster on Google Cloud Platform. The Kubernetes cluster contains a deployment which has one pod. The pod has two containers. I have observed that the pod has been replaced by a new pod and the entire data is wiped out. I am not able to identify the reason behind it.

I have tried the below two commands:

  1. kubectl logs [podname] -c [containername] --previous

**Result: ** previous terminated container [containername] in pod [podname] not found

  1. kubectl get pods

Result: I see that the number of restarts for my pod equals 0.

Is there anything I could do to get the logs from my old pod?

Upvotes: 0

Views: 3082

Answers (2)

Vit
Vit

Reputation: 8491

Not many chances you will retrieve this information, but try next:

1) If you know your failed container id - try to find old logs here

/var/lib/docker/containers/<container id>/<container id>-json.log

2) look at kubelet's logs:

journalctl -u kubelet

Upvotes: 0

P Ekambaram
P Ekambaram

Reputation: 17689

Try below command to see the pod info kubectl describe po

Upvotes: 0

Related Questions