From bb700001e6cc1a90249c48f64c635242e5b3d9ac Mon Sep 17 00:00:00 2001 From: windsonsea Date: Thu, 6 Jul 2023 09:19:13 +0800 Subject: [PATCH] [zh] sync logging.md and system-logs.md --- .../cluster-administration/logging.md | 34 ++++--- .../cluster-administration/system-logs.md | 21 ++-- content/zh-cn/docs/test.md | 97 ++++++++++--------- 3 files changed, 76 insertions(+), 76 deletions(-) diff --git a/content/zh-cn/docs/concepts/cluster-administration/logging.md b/content/zh-cn/docs/concepts/cluster-administration/logging.md index 5c286e8044..3db4e98b3f 100644 --- a/content/zh-cn/docs/concepts/cluster-administration/logging.md +++ b/content/zh-cn/docs/concepts/cluster-administration/logging.md @@ -118,12 +118,13 @@ appending a container name to the command, with a `-c` flag, like so: 如果你的 Pod 有多个容器,请如下通过将容器名称追加到该命令并使用 `-c` 标志来指定要访问哪个容器的日志: -```console +```shell kubectl logs counter -c count ``` 详见 [`kubectl logs` 文档](/docs/reference/generated/kubectl/kubectl-commands#logs)。 @@ -167,7 +168,8 @@ kubelet 通过 Kubernetes API 的特殊功能将日志提供给客户端访问 @@ -180,7 +182,8 @@ kubelet(使用 CRI)将此信息发送到容器运行时,而运行时则将 You can configure two kubelet [configuration settings](/docs/reference/config-api/kubelet-config.v1beta1/), `containerLogMaxSize` and `containerLogMaxFiles`, using the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file/). -These settings let you configure the maximum size for each log file and the maximum number of files allowed for each container respectively. +These settings let you configure the maximum size for each log file and the maximum number of +files allowed for each container respectively. When you run [`kubectl logs`](/docs/reference/generated/kubectl/kubectl-commands#logs) as in the basic logging example, the kubelet on the node handles the request and @@ -196,8 +199,7 @@ kubelet [配置选项](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/# {{< note >}} -你还可以使用已弃用的 kubelet 命令行参数 `--log-dir` 设置日志目录。 -但是,kubelet 始终指示你的容器运行时将日志写入 `/var/log/pods` 中的目录。 +kubelet 始终指示你的容器运行时将日志写入 `/var/log/pods` 中的目录。 有关 `kube-log-runner` 的更多信息,请阅读[系统日志](/zh-cn/docs/concepts/cluster-administration/system-logs/#klog)。 @@ -393,7 +393,8 @@ application containers on that node. Because the logging agent must run on every node, it is recommended to run the agent as a `DaemonSet`. -Node-level logging creates only one agent per node and doesn't require any changes to the applications running on the node. +Node-level logging creates only one agent per node and doesn't require any changes to the +applications running on the node. --> 由于日志记录代理必须在每个节点上运行,推荐以 `DaemonSet` 的形式运行该代理。 @@ -417,7 +418,8 @@ You can use a sidecar container in one of the following ways: * 边车容器将应用程序日志传送到自己的标准输出。 * 边车容器运行一个日志代理,配置该日志代理以便从应用容器收集日志。 @@ -646,7 +648,8 @@ The pod mounts a volume where fluentd can pick up its configuration data. ![直接从应用程序暴露日志](/images/docs/user-guide/logging/logging-from-application.png) 从各个应用中直接暴露和推送日志数据的集群日志机制已超出 Kubernetes 的范围。 @@ -655,7 +658,8 @@ Cluster-logging that exposes or pushes logs directly from every application is o * 阅读有关 [Kubernetes 系统日志](/zh-cn/docs/concepts/cluster-administration/system-logs/)的信息 * 进一步了解[追踪 Kubernetes 系统组件](/zh-cn/docs/concepts/cluster-administration/system-traces/) diff --git a/content/zh-cn/docs/concepts/cluster-administration/system-logs.md b/content/zh-cn/docs/concepts/cluster-administration/system-logs.md index 54ac577a39..e815ac4785 100644 --- a/content/zh-cn/docs/concepts/cluster-administration/system-logs.md +++ b/content/zh-cn/docs/concepts/cluster-administration/system-logs.md @@ -33,24 +33,20 @@ scheduler decisions). klog 是 Kubernetes 的日志库。 [klog](https://github.com/kubernetes/klog) 为 Kubernetes 系统组件生成日志消息。 -有关 klog 配置的更多信息,请参见[命令行工具参考](/zh-cn/docs/reference/command-line-tools-reference/)。 - -Kubernetes 正在进行简化其组件日志的努力。下面的 klog 命令行参数从 Kubernetes 1.23 +Kubernetes 正在进行简化其组件日志的努力。下面的 klog 命令行参数从 Kubernetes v1.23 开始[已被废弃](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components), -会在未来版本中移除: +在 Kubernetes v1.26 中被移除: - `--add-dir-header` - `--alsologtostderr` @@ -168,7 +164,7 @@ compatible with traditional klog: --> 默认的结构化日志消息是以文本形式呈现的,其格式与传统的 klog 保持向后兼容: -```ini +``` "" ="" ="" ... ``` @@ -177,7 +173,7 @@ Example: --> 示例: -```ini +``` I1025 00:15:15.525108 1 controller_utils.go:116] "Pod status updated" pod="kube-system/kubedns" status="ready" ``` @@ -449,10 +445,9 @@ The complete list of options that can be used are: --> kubelet 使用启发方式来检索日志。 如果你还未意识到给定的系统服务正将日志写入到操作系统的原生日志记录程序(例如 journald) -或 `/var/log/` 中的日志文件,这会很有帮助。 -这种启发方式先检查原生的日志记录程序,如果不可用,则尝试从 -`/var/log/`、`/var/log/.log` 或 `/var/log//.log` -中检索第一批日志。 +或 `/var/log/` 中的日志文件,这会很有帮助。这种启发方式先检查原生的日志记录程序, +如果不可用,则尝试从 `/var/log/`、`/var/log/.log` +或 `/var/log//.log` 中检索第一批日志。 可用选项的完整列表如下: diff --git a/content/zh-cn/docs/test.md b/content/zh-cn/docs/test.md index 12ac9c8bb9..ebd6b3004d 100644 --- a/content/zh-cn/docs/test.md +++ b/content/zh-cn/docs/test.md @@ -116,9 +116,9 @@ Markdown doesn't have strict rules about how to process lists. When we moved from Jekyll to Hugo, we broke some lists. To fix them, keep the following in mind: -- Make sure you indent sub-list items **2 spaces**. +- Make sure you indent sub-list items **2 spaces**. -- To end a list and start another, you need a HTML comment block on a new line +- To end a list and start another, you need an HTML comment block on a new line between the lists, flush with the left-hand border. The first list won't end otherwise, no matter how many blank lines you put between it and the second. --> @@ -133,18 +133,18 @@ Markdown 在如何处理列表方面没有严格的规则。在我们从 Jekyll ### 项目符号列表 {#bullet-lists} -- 此为列表条目 -* 此为另一列表条目,位于同一列表中 -- 你可以将 `-` 和 `*` 混合使用 +- 此为列表条目。 +* 此为另一列表条目,位于同一列表中。 +- 你可以将 `-` 和 `*` 混合使用。 - 要开始子列表,缩进两个空格。 - 这是另一个子子条目。进一步多缩进两个空格。 - 另一个子条目。 @@ -178,8 +178,8 @@ Markdown 在如何处理列表方面没有严格的规则。在我们从 Jekyll - 项目符号列表条目中还可以包含编号列表。 1. 编号子列表条目一 @@ -194,44 +194,41 @@ Markdown 在如何处理列表方面没有严格的规则。在我们从 Jekyll ### 编号列表 {#numbered-lists} 1. 此为列表条目 -2. 此为列表中的第二个条目。在 Markdown 源码中所给的编号数字与最终输出的数字 +1. 此为列表中的第二个条目。在 Markdown 源码中所给的编号数字与最终输出的数字 可能不同。建议在紧凑列表中编号都使用 1。如果条目之间有其他内容(比如注释 掉的英文)存在,则需要显式给出编号。 -3. {{}} - - 对于单个数字的编号列表,在句点(`.`)后面加两个空格。这样有助于将列表的 - 内容更好地对齐。 - {{}} + +{{}} + +对于单个数字的编号列表,在句点(`.`)后面加两个空格。这样有助于将列表的 +内容更好地对齐。 +{{}} 1. 这是一个新的列表。 使用 Hugo 时,你需要用 HTML 注释将两个紧挨着的列表分开。 **HTML 注释需要按左边顶边对齐。** -2. 编号列表条目中也可以包含额外的段落或者块元素。 +1. 编号列表条目中也可以包含额外的段落或者块元素。 后续段落应该按编号列表文字的第一行左侧对齐。 **此段落及下面的代码段都与本条目中的第一个字“编”对齐。** @@ -242,8 +239,8 @@ Markdown 在如何处理列表方面没有严格的规则。在我们从 Jekyll - 编号列表条目中可以在块级内容之后有子列表。子列表的符号项要与上层列表条目文字左侧对齐。 @@ -477,20 +474,23 @@ source for this page). ## Links To format a link, put the link text inside square brackets, followed by the -link target in parentheses. [Link to Kubernetes.io](https://kubernetes.io/) or -[Relative link to Kubernetes.io](/) +link target in parentheses. + +- `[Link to Kubernetes.io](https://kubernetes.io/)` or +- `[Relative link to Kubernetes.io](/)` You can also use HTML, but it is not preferred. -Link to Kubernetes.io +For example, `Link to Kubernetes.io`. --> ## 链接 {#links} 要格式化链接,将链接显示文本放在方括号中,后接用圆括号括起来的链接目标。 -[指向 Kubernetes.io 的链接](https://kubernetes.io/)或 -[到 Kubernetes.io 的相对链接](/)。 + +- `[指向 Kubernetes.io 的链接](https://kubernetes.io/)`或 +- `[到 Kubernetes.io 的相对链接](/)` 你也可以使用 HTML,但这种方式不是推荐的方式。 -到 Kubernetes.io 的链接。 +例如,`到 Kubernetes.io 的链接`。 ### 中文链接 @@ -595,7 +595,7 @@ You can also use HTML for images, but it is not preferred. 即使你不想使用 figure 短代码,图片也可以展示为链接。这里,铅笔图标指向 Kubernetes 网站。外层的方括号将整个 image 标签封装起来,链接目标在末尾的圆括号之间给出。 -[![pencil icon](/images/pencil.png)](https://kubernetes.io) +[![铅笔图标](/images/pencil.png)](https://kubernetes.io) 你也可以使用 HTML 来嵌入图片,不过这种方式是不推荐的。 @@ -690,7 +690,7 @@ graph TD; ``` 会产生: @@ -742,7 +742,7 @@ sequenceDiagram ``` 会产生: @@ -772,9 +772,9 @@ sequenceDiagram {{}} -
在官方网站上有更多的[示例](https://mermaid-js.github.io/mermaid/#/examples)。 +你可以查阅官方网站上的更多[示例](https://mermaid-js.github.io/mermaid/#/examples)。