I have a kubernetes cluster in google container engine but container in a kubernetes cluster is being restarted.
Couple of times, hosted website went down.When I look at the container logs; I see that the normal startup sequence has recently completed, so I assume the container has died (or was it killed?) And restarted.
How I figure out how and why this is happening?
So I try to see, is there a way to get a warning or notification when the container starts / stops unexpectedly?
Here what I found a right solution –
To view the latest container restart logs, just type this command below.
kubectl logs podname -c container_name - previous
Or you can also try this, kubectl get pods will show the number of restarts,
kubectl describe under name