[英]How to view container logs in GKE's Logs Explorer
在我的 GKE 集群(版本 v1.21.10-gke.2000)中,我希望在 Logs Explorer 中看到 pod/containers 生成的輸出作為日志。
但是單擊 Workloads 的 Overview 選項卡中的 Container Logs 鏈接會使 Logs Explorer 返回“No data found”。 Cloud Logging 已啟用(組件:系統、工作負載)。 Cloud Logging API 也已啟用。
到目前為止我所嘗試的:在新創建的集群(版本 1.22.8-gke.201)中的另一個(測試)項目中,這可以正常工作,即kubectl logs
返回的內容在日志資源管理器中也可見。 開頭提到的集群是很久以前創建的,顯然需要進行一些更改——我如何才能確定需要修改哪些集群(或者可能是節點池)設置才能在 Logs Explorer 中查看容器日志? 我想避免從頭開始創建新集群。
如果您在 Cloud Logging 中看不到任何日志,您可以嘗試本文檔中有關How to find—and use—your GKE logs with Cloud Logging
說明,並找到Make sure you're collecting GKE logs
部分。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.