I have a Golang application running on Kubernetes, but when the pod dies there are no error message at all. What should I do?

1/22/2018

As titled.

When I run kubectl logs my-go-app-deployment-1967699436-yxxn7 or kubectl logs my-go-app-deployment-1967699436-yxxn7 -p, there are no error log print out at all.

What should I do? What makes a Golang pods crashes?

-- tom10271
go
kubernetes
logging

1 Answer

1/22/2018

First you should inspect the pod to see the reason why it died and if it was restarted.

kubectl describe pod my-go-app-deployment-1967699436-yxxn7

Look for entries in Containers -> your container -> Last State.

If it was restarted you might want to check the previous logs as well:

kubectl logs --previous pod my-go-app-deployment-1967699436-yxxn7
-- tex
Source: StackOverflow