Skip to content

Commit c17ed38

Browse files
authored
Merge pull request #33505 from nameYULI/yl15
[zh]Update content/zh/docs/tasks/administer-cluster/dns-debugging-resolution.md
2 parents d401812 + 33ccd55 commit c17ed38

File tree

1 file changed

+72
-10
lines changed

1 file changed

+72
-10
lines changed

content/zh/docs/tasks/administer-cluster/dns-debugging-resolution.md

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ The service name is `kube-dns` for both CoreDNS and kube-dns deployments.
262262
<!--
263263
If you have created the Service or in the case it should be created by default
264264
but it does not appear, see
265-
[debugging Services](/docs/tasks/debug-application-cluster/debug-service/) for
265+
[debugging Services](/docs/tasks/debug/debug-application/debug-service/) for
266266
more information.
267267
-->
268268
如果你已经创建了 DNS 服务,或者该服务应该是默认自动创建的但是它并没有出现,
269-
请阅读[调试服务](/zh/docs/tasks/debug-application-cluster/debug-service/)
269+
请阅读[调试服务](/zh/docs/tasks/debug/debug-application/debug-service/)
270270
来获取更多信息。
271271

272272
<!--
@@ -290,14 +290,14 @@ kube-dns 10.180.3.17:53,10.180.3.17:53 1h
290290

291291
<!--
292292
If you do not see the endpoints, see endpoints section in the
293-
[debugging services](/docs/tasks/debug-application-cluster/debug-service/) documentation.
293+
[debugging services](/docs/tasks/debug/debug-application/debug-service/) documentation.
294294
295295
For additional Kubernetes DNS examples, see the
296296
[cluster-dns examples](https://github.com/kubernetes/examples/tree/master/staging/cluster-dns)
297297
in the Kubernetes GitHub repository.
298298
-->
299299
如果你没看到对应的端点,请阅读
300-
[调试服务](/zh/docs/tasks/debug-application-cluster/debug-service/)的端点部分。
300+
[调试服务](/zh/docs/tasks/debug/debug-application/debug-service/)的端点部分。
301301

302302
若需要了解更多的 Kubernetes DNS 例子,请在 Kubernetes GitHub 仓库里查看
303303
[cluster-dns 示例](https://github.com/kubernetes/examples/tree/master/staging/cluster-dns)
@@ -374,6 +374,74 @@ linux/amd64, go1.10.3, 2e322f6
374374
2018/09/07 15:29:04 [INFO] Reloading complete
375375
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
376376

377+
```
378+
<!--
379+
### Does CoreDNS have sufficient permissions?
380+
381+
CoreDNS must be able to list {{< glossary_tooltip text="service"
382+
term_id="service" >}} and {{< glossary_tooltip text="endpoint"
383+
term_id="endpoint" >}} related resources to properly resolve service names.
384+
385+
Sample error message:
386+
-->
387+
### CoreDNS 是否有足够的权限?
388+
389+
CoreDNS 必须能够列出 {{< glossary_tooltip text="service" term_id="service" >}} 和
390+
{{< glossary_tooltip text="endpoint" term_id="endpoint" >}} 相关的资源来正确解析服务名称。
391+
392+
示例错误消息:
393+
```
394+
2022-03-18T07:12:15.699431183Z [INFO] 10.96.144.227:52299 - 3686 "A IN serverproxy.contoso.net.cluster.local. udp 52 false 512" SERVFAIL qr,aa,rd 145 0.000091221s
395+
```
396+
397+
<!--
398+
First, get the current ClusterRole of `system:coredns`:
399+
-->
400+
首先,获取当前的 ClusterRole `system:coredns`
401+
402+
```shell
403+
kubectl describe clusterrole system:coredns -n kube-system
404+
```
405+
406+
<!--
407+
Expected output:
408+
-->
409+
预期输出:
410+
```
411+
PolicyRule:
412+
Resources Non-Resource URLs Resource Names Verbs
413+
--------- ----------------- -------------- -----
414+
nodes [] [] [get]
415+
endpoints [] [] [list watch]
416+
namespaces [] [] [list watch]
417+
pods [] [] [list watch]
418+
services [] [] [list watch]
419+
endpointslices.discovery.k8s.io [] [] [list watch]
420+
```
421+
422+
<!--
423+
If any permissions are missing, edit the ClusterRole to add them:
424+
-->
425+
如果缺少任何权限,请编辑 ClusterRole 来添加它们:
426+
427+
```shell
428+
kubectl edit clusterrole system:coredns -n kube-system
429+
```
430+
431+
<!--
432+
Example insertion of EndpointSlices permissions:
433+
-->
434+
EndpointSlices 权限的插入示例:
435+
```
436+
...
437+
- apiGroups:
438+
- discovery.k8s.io
439+
resources:
440+
- endpointslices
441+
verbs:
442+
- list
443+
- watch
444+
...
377445
```
378446

379447
<!--
@@ -386,9 +454,6 @@ If the namespace of the pod and service differ, the DNS query must include
386454
the namespace of the service.
387455
388456
This query is limited to the pod's namespace:
389-
```shell
390-
kubectl exec -i -t dnsutils -- nslookup <service-name>
391-
```
392457
-->
393458
### 你的服务在正确的命名空间中吗?
394459

@@ -403,9 +468,6 @@ kubectl exec -i -t dnsutils -- nslookup <service-name>
403468

404469
<!--
405470
This query specifies the namespace:
406-
```shell
407-
kubectl exec -i -t dnsutils -- nslookup <service-name>.<namespace>
408-
```
409471
-->
410472
指定命名空间的查询:
411473
```shell

0 commit comments

Comments
 (0)