Skip to content

Commit 51fa56f

Browse files
authored
Merge pull request #34608 from Cosrider/main
[zh-cn] Update customize-hosts-file-for-pods.md
2 parents 67a4995 + 67e9a06 commit 51fa56f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

content/zh-cn/docs/tasks/network/customize-hosts-file-for-pods.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: 使用 HostAliases 向 Pod /etc/hosts 文件添加条目
3-
content_type: concept
3+
content_type: task
44
weight: 60
55
min-kubernetes-server-version: 1.7
66
---
@@ -22,7 +22,7 @@ Adding entries to a Pod's /etc/hosts file provides Pod-level override of hostnam
2222
2323
Modification not using HostAliases is not suggested because the file is managed by Kubelet and can be overwritten on during Pod creation/restart.
2424
-->
25-
当 DNS 配置以及其它选项不合理的时候,通过向 Pod 的 /etc/hosts 文件中添加条目,
25+
当 DNS 配置以及其它选项不合理的时候,通过向 Pod 的 `/etc/hosts` 文件中添加条目,
2626
可以在 Pod 级别覆盖对主机名的解析。你可以通过 PodSpec 的 HostAliases
2727
字段来添加这些自定义条目。
2828

@@ -86,7 +86,7 @@ fe00::2 ip6-allrouters
8686
By default, the `hosts` file only includes IPv4 and IPv6 boilerplates like
8787
`localhost` and its own hostname.
8888
-->
89-
默认情况下,hosts 文件只包含 IPv4 和 IPv6 的样板内容,像 `localhost` 和主机名称。
89+
默认情况下,`hosts` 文件只包含 IPv4 和 IPv6 的样板内容,像 `localhost` 和主机名称。
9090

9191
<!--
9292
## Adding Additional Entries with HostAliases
@@ -99,7 +99,7 @@ For example: to resolve `foo.local`, `bar.local` to `127.0.0.1` and `foo.remote`
9999
-->
100100
## 通过 HostAliases 增加额外条目
101101

102-
除了默认的样板内容,我们可以向 hosts 文件添加额外的条目。
102+
除了默认的样板内容,我们可以向 `hosts` 文件添加额外的条目。
103103
例如,要将 `foo.local``bar.local` 解析为 `127.0.0.1`
104104
`foo.remote``bar.remote` 解析为 `10.1.2.3`,我们可以在
105105
`.spec.hostAliases` 下为 Pod 配置 HostAliases。
@@ -136,7 +136,7 @@ hostaliases-pod 0/1 Completed 0 6s 10.200.0.5 w
136136
<!--
137137
The `hosts` file content looks like this:
138138
-->
139-
hosts 文件的内容看起来类似如下这样
139+
`hosts` 文件的内容看起来类似如下所示
140140

141141
```shell
142142
kubectl logs hostaliases-pod

0 commit comments

Comments
 (0)