136. 如何在 Rancher Kubernetes Engine(RKE)CLI 或 Rancher v2.x 配置的 RKE 集群中启用 CoreDNS 查询日志
By default, DNS query logging is disabled in CoreDNS, this article details the steps to enable query logging for CoreDNS in an RKE Kubernetes cluster provisioned by the Rancher Kubernetes Engine (RKE) CLI or Rancher v2.x.默认情况下CoreDNS 中禁用了 DNS 查询日志本文详细介绍了在由 Rancher Kubernetes Engine RKE CLI 或 Rancher v2.x 配置的 RKE Kubernetes 集群中启用 CoreDNS 查询日志的步骤。Resolution 结局To enable DNS query logging the log plugin needs to be configured, by the addition oflogto the Corefile in the coredns ConfigMap of the kube-system Namespace.要启用 DNS 查询日志需要配置日志插件 方法是在 kube 系统命名空间的 coredns ConfigMap 中添加日志。For example, to use the default log plugin configuration and log all queries, the Corefile definition would be updated as follows:例如要使用默认日志插件配置并记录所有查询Corefile 定义将更新如下span stylecolor:#000000span stylebackground-color:#ffffffspan stylebackground-color:#f3f3f3.:53 { log errors health ready kubernetes cluster.local a>Steps to update the CoreDNS ConfigMap and persist these changes can be found in the article How to update the CoreDNS ConfigMap in a Rancher Kubernetes Engine (RKE) CLI or Rancher v2.x provisioned Kubernetes cluster.更新 CoreDNS ConfigMap 并持久化这些更改的步骤可见于 《如何在 Rancher Kubernetes Engine RKE CLI 或 Rancher v2.x provisioned Kubernetes 集群中更新 CoreDNS ConfigMap》一文。For the full list of available options when configuring the log plugin refer to the plugin documentation.关于配置日志插件时可用的完整选项列表请参阅插件文档 。Cause 病因Additional Information 附加信息CoreDNS log plugin documentationCoreDNS 日志插件文档Environment 环境An RKE Kubernetes cluster provisioned by the Rancher Kubernetes Engine (RKE) CLI or Rancher v2.x, using the CoreDNS dns add-on.由 Rancher Kubernetes Engine RKE CLI 或 Rancher v2.x 配置的 RKE Kubernetes 集群使用 CoreDNS DNS 插件。访问Rancher-K8S解决方案博主企业合作伙伴 https://blog.csdn.net/lidw2009