本文介绍了GKE kubernetes容器标准输出日志格式已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用的容器中的STDOUT日志用

STDOUT logs from containers used be logged with

logName=projects/[PROJECT-NAME]/logs/[CONTAINER-NAME]

资源对象的值曾经是

resource.type=container,
resource.namespace_id=[NAMESPACE_NAME] 
resource.pod_id=[POD_NAME]

升级到1.11.2-gke.18后,在禁用了旧式端点的节点池中:

容器的STDOUT日志使用

After upgrading to 1.11.2-gke.18, with a nodepool with legacy endpoints disabled:

STDOUT logs from containers are being logged with

logName=projects/[PROJECT-NAME]/logs/stdout

资源对象的值现在是

resource.type=k8s_container
resource.namespace_name=[NAMESPACE_NAME] 
resource.pod_name=[POD_NAME]

但Google云日志控制台基本查看器尚未与以下更改兼容:

but the google cloud logging console basic viewer is not yet compatible with these changes:

选择"GKE容器">"cluster_name">"namespace_name",不会显示这些日志条目-如果不更新我的所有脚本以进行查询,该问题的解决方案/解决方案是什么?

selecting GKE Container > cluster_name > namespace_name, does not bring up these log entries - what could be the solution/fix to this problem, short of updating all my scripts to query?

推荐答案

如果进入日志查看器"下拉列表,则应该看到一个名为"Kubernetes容器"的选项.在GKE群集上启用Stackdriver V2 beta时引入了此功能.因此,要查看这些日志,您将转到Kubernetes容器>集群名称>命名空间名称>容器名称.您可以在此处

If you go into the Log Viewer drop down list, you should see an option called "Kubernetes Container". This was introduced when you enable Stackdriver V2 beta on the GKE cluster. So to see these logs, you will go Kubernetes Container>Cluster_Name>namespace_name>container_name. You can read more about Stakdriver Kurbenetes here

这篇关于GKE kubernetes容器标准输出日志格式已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:47