查询 Config Sync 日志
bookmark_borderbookmark
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页面包含可与 Logs Explorer 搭配使用的查询。您可以使用这些查询来检索、查看和分析日志数据。这些日志可能包含在操作器或协调器 Pod 重启时,nomos bugreport
未能捕获的有价值历史数据。
如需查找最重要的日志,请按严重级别对问题进行排序,然后调整时间戳以控制时间范围。
查询/过滤条件名称 |
表达式 |
备注 |
检查 reconciler-manager 日志 |
resource.type="k8s_container"
resource.labels.project_id="PROJECT_ID"
resource.labels.cluster_name="CLUSTER_NAME"
resource.labels.namespace_name="config-management-system"
resource.labels.container_name="reconciler-manager"
timestamp >= "START_TIME"
timestamp <= "STOP_TIME"
|
|
检查命名空间代码库的协调器日志 |
resource.type="k8s_container"
resource.labels.project_id="PROJECT_ID"
resource.labels.cluster_name="CLUSTER_NAME"
resource.labels.namespace_name="config-management-system"
resource.labels.container_name="reconciler"
resource.labels.pod_name:"ns-reconciler-NAMESPACE"
timestamp >= "START_TIME"
timestamp <= "STOP_TIME"
|
如需查看 git-sync 日志,请将 resource.laels.container_name 更改为 git-sync 。如需查看根协调器日志,请将 resource.labels.pod_name 更改为 root-reconciler 。
|
检查集群是否在一段时间内进行了升级 |
resource.type="gke_cluster"
resource.labels.project_id="PROJECT_ID"
resource.labels.cluster_name="CLUSTER_NAME"
resource.labels.location="LOCATION"
timestamp >= "START_TIME"
timestamp <= "STOP_TIME"
|
如果您查询的集群未升级,则结果为空。
|
检查协调器 Pod 是否未能启动 |
resource.type="k8s_pod"
resource.labels.project_id="PROJECT_ID"
resource.labels.cluster_name="CLUSTER_NAME"
resource.labels.location="LOCATION"
resource.labels.pod_name:"ns-reconciler-NAMESPACE"
timestamp >= "START_TIME"
timestamp <= "STOP_TIME"
|
如果您看到 Config Sync 相关 Pod 方面的错误,则表示这些 Pod 无法在关联的时间戳启动。
|
检查 ConfigMap 的操作 |
resource.type="k8s_cluster"
resource.labels.project_id="PROJECT_ID"
resource.labels.cluster_name="CLUSTER_NAME"
resource.labels.location="LOCATION"
protoPayload.methodName:"io.k8s.core.v1.configmaps"
protoPayload.resourceName:"core/v1/namespaces/config-management-system/configmaps/ns-reconciler-cap-logging-service"
timestamp >= "START_TIME"
timestamp <= "STOP_TIME"
|
|
检查 RepoSync 的操作 |
resource.type="k8s_cluster"
resource.labels.project_id="PROJECT_ID"
resource.labels.cluster_name="CLUSTER_NAME"
resource.labels.location="LOCATION"
protoPayload.methodName:"reposyncs"
protoPayload.resourceName:"namespaces/cap-logging-service/reposyncs"
timestamp >= "START_TIME"
timestamp <= "STOP_TIME"
|
|
列出 git-sync 所同步的所有 Git 修订版本 |
resource.type="k8s_container"
resource.labels.project_id="PROJECT_ID"
resource.labels.location="LOCATION"
resource.labels.cluster_name="CLUSTER_NAME"
resource.labels.namespace_name="config-management-system"
resource.labels.pod_name:"git-importer-" severity>=DEFAULT
"adding worktree"
|
|
请替换以下内容:
PROJECT_ID
:您的项目 ID。
CLUSTER_NAME
:您要查询的集群的名称。
START_TIME
:设置您要开始收集日志的时间。在编写带有时间戳的查询时,您必须使用以下格式:YYYY-MM-DDT00:00:00Z。
STOP_TIME
:设置您要停止收集日志的时间。在编写带有时间戳的查询时,您必须使用以下格式:YYYY-MM-DDT00:00:00Z。
NAMESPACE
:您在其中创建了命名空间代码库的命名空间。
LOCATION
:您在其中创建了集群的位置。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-06。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-06。"],[],[]]