![](/img/trans.png)
[英]How to determine what kind of error message I should return from golang API?
[英]I have a Golang application running on Kubernetes, but when the pod dies there are no error message at all. What should I do?
如標題。
當我運行kubectl logs my-go-app-deployment-1967699436-yxxn7
或kubectl logs my-go-app-deployment-1967699436-yxxn7 -p
,根本不會輸出錯誤日志。
我該怎么辦? 是什么讓Golang吊艙崩潰?
首先,您應該檢查吊艙以查看其死亡原因以及是否重新啟動。
kubectl describe pod my-go-app-deployment-1967699436-yxxn7
在容器->您的容器->最后狀態中查找條目。
如果重新啟動,您可能還需要檢查以前的日志:
kubectl logs --previous pod my-go-app-deployment-1967699436-yxxn7
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.