@@ -29,7 +29,6 @@ Your cluster must be configured to use the CoreDNS
29
29
{{< glossary_tooltip text="addon" term_id="addons" >}} or its precursor,
30
30
kube-dns.
31
31
-->
32
-
33
32
你的集群必须使用了 CoreDNS {{< glossary_tooltip text="插件" term_id="addons" >}}
34
33
或者其前身,` kube-dns ` 。
35
34
@@ -39,27 +38,25 @@ kube-dns.
39
38
40
39
<!--
41
40
### Create a simple Pod to use as a test environment
42
-
43
- {{% code_sample file="admin/dns/dnsutils.yaml" %}}
44
-
45
- {{< note >}}
46
- This example creates a pod in the `default` namespace. DNS name resolution for
47
- services depends on the namespace of the pod. For more information, review
48
- [DNS for Services and Pods](/docs/concepts/services-networking/dns-pod-service/#what-things-get-dns-names).
49
- {{< /note >}}
50
-
51
- Use that manifest to create a Pod:
52
41
-->
53
42
### 创建一个简单的 Pod 作为测试环境 {#create-a-simple-pod-to-use-as-a-test-environment}
54
43
55
44
{{< codenew file="admin/dns/dnsutils.yaml" >}}
56
45
57
46
{{< note >}}
47
+ <!--
48
+ This example creates a pod in the `default` namespace. DNS name resolution for
49
+ services depends on the namespace of the pod. For more information, review
50
+ [DNS for Services and Pods](/docs/concepts/services-networking/dns-pod-service/#what-things-get-dns-names).
51
+ -->
58
52
此示例在 ` default ` 名字空间创建 Pod。
59
53
服务的 DNS 名字解析取决于 Pod 的名字空间。
60
54
详细信息请查阅 [ Pod 与 Service 的 DNS] ( /zh-cn/docs/concepts/services-networking/dns-pod-service/#what-things-get-dns-names ) 。
61
55
{{< /note >}}
62
56
57
+ <!--
58
+ Use that manifest to create a Pod:
59
+ -->
63
60
使用上面的清单来创建一个 Pod:
64
61
65
62
``` shell
@@ -121,7 +118,7 @@ Take a look inside the resolv.conf file.
121
118
122
119
查看 resolv.conf 文件的内容
123
120
(阅读[ 定制 DNS 服务] ( /zh-cn/docs/tasks/administer-cluster/dns-custom-nameservers/ ) 和
124
- 后文的[ 已知问题] ( #known-issues ) ,获取更多信息)
121
+ 后文的[ 已知问题] ( #known-issues ) ,获取更多信息)
125
122
126
123
``` shell
127
124
kubectl exec -ti dnsutils -- cat /etc/resolv.conf
@@ -132,7 +129,7 @@ Verify that the search path and name server are set up like the following
132
129
(note that search path may vary for different cloud providers):
133
130
-->
134
131
验证 search 和 nameserver 的配置是否与下面的内容类似
135
- (注意 search 根据不同的云提供商可能会有所不同) :
132
+ (注意 search 根据不同的云提供商可能会有所不同) :
136
133
137
134
```
138
135
search default.svc.cluster.local svc.cluster.local cluster.local google.internal c.gce_project_id.internal
@@ -159,6 +156,9 @@ Address 1: 10.0.0.10
159
156
nslookup: can't resolve 'kubernetes.default'
160
157
```
161
158
159
+ <!--
160
+ or
161
+ -->
162
162
或者
163
163
164
164
``` shell
@@ -197,10 +197,10 @@ coredns-7b96bf9f76-mvmmt 1/1 Running 0 1h
197
197
...
198
198
```
199
199
200
+ {{< note >}}
200
201
<!--
201
202
The value for label `k8s-app` is `kube-dns` for both CoreDNS and kube-dns deployments.
202
203
-->
203
- {{< note >}}
204
204
对于 CoreDNS 和 kube-dns 部署而言,标签 ` k8s-app ` 的值都应该是 ` kube-dns ` 。
205
205
{{< /note >}}
206
206
@@ -271,11 +271,10 @@ kube-dns ClusterIP 10.0.0.10 <none> 53/UDP,53/TCP 1h
271
271
...
272
272
```
273
273
274
+ {{< note >}}
274
275
<!--
275
276
The service name is `kube-dns` for both CoreDNS and kube-dns deployments.
276
277
-->
277
-
278
- {{< note >}}
279
278
不管是 CoreDNS 还是 kube-dns,这个服务的名字都会是 ` kube-dns ` 。
280
279
{{< /note >}}
281
280
@@ -286,8 +285,7 @@ but it does not appear, see
286
285
more information.
287
286
-->
288
287
如果你已经创建了 DNS 服务,或者该服务应该是默认自动创建的但是它并没有出现,
289
- 请阅读[ 调试服务] ( /zh-cn/docs/tasks/debug/debug-application/debug-service/ )
290
- 来获取更多信息。
288
+ 请阅读[ 调试服务] ( /zh-cn/docs/tasks/debug/debug-application/debug-service/ ) 来获取更多信息。
291
289
292
290
<!--
293
291
### Are DNS endpoints exposed?
@@ -316,11 +314,11 @@ For additional Kubernetes DNS examples, see the
316
314
[cluster-dns examples](https://github.com/kubernetes/examples/tree/master/staging/cluster-dns)
317
315
in the Kubernetes GitHub repository.
318
316
-->
319
- 如果你没看到对应的端点,请阅读
320
- [ 调试服务] ( /zh-cn/docs/tasks/debug/debug-application/debug-service/ ) 的端点部分。
317
+ 如果你没看到对应的端点,
318
+ 请阅读 [ 调试服务] ( /zh-cn/docs/tasks/debug/debug-application/debug-service/ ) 的端点部分。
321
319
322
320
若需要了解更多的 Kubernetes DNS 例子,请在 Kubernetes GitHub 仓库里查看
323
- [ cluster-dns 示例] ( https://github.com/kubernetes/examples/tree/master/staging/cluster-dns ) 。
321
+ [ cluster-dns 示例] ( https://github.com/kubernetes/examples/tree/master/staging/cluster-dns ) 。
324
322
325
323
<!--
326
324
### Are DNS queries being received/processed?
@@ -394,8 +392,8 @@ linux/amd64, go1.10.3, 2e322f6
394
392
2018/09/07 15:29:04 [INFO] plugin/reload : Running configuration MD5 = 162475cdf272d8aa601e6fe67a6ad42f
395
393
2018/09/07 15:29:04 [INFO] Reloading complete
396
394
172.17.0.18:41675 - [07/Sep/2018:15:29:11 +0000] 59925 "A IN kubernetes.default.svc.cluster.local. udp 54 false 512" NOERROR qr,aa,rd,ra 106 0.000066649s
397
-
398
395
```
396
+
399
397
<!--
400
398
### Does CoreDNS have sufficient permissions?
401
399
@@ -454,6 +452,7 @@ kubectl edit clusterrole system:coredns -n kube-system
454
452
Example insertion of EndpointSlices permissions:
455
453
-->
456
454
EndpointSlices 权限的插入示例:
455
+
457
456
```
458
457
...
459
458
- apiGroups:
@@ -528,7 +527,8 @@ Kubernetes installs do not configure the nodes' `resolv.conf` files to use the
528
527
cluster DNS by default, because that process is inherently distribution-specific.
529
528
This should probably be implemented eventually.
530
529
-->
531
- Kubernetes 的安装并不会默认配置节点的 ` resolv.conf ` 文件来使用集群的 DNS 服务,因为这个配置对于不同的发行版本是不一样的。这个问题应该迟早会被解决的。
530
+ Kubernetes 的安装并不会默认配置节点的 ` resolv.conf ` 文件来使用集群的 DNS 服务,
531
+ 因为这个配置对于不同的发行版本是不一样的。这个问题应该迟早会被解决的。
532
532
533
533
<!--
534
534
Linux's libc (a.k.a. glibc) has a limit for the DNS `nameserver` records to 3 by
0 commit comments