|
2 | 2 | title: 调试 DNS 问题
|
3 | 3 | content_type: task
|
4 | 4 | min-kubernetes-server-version: v1.6
|
| 5 | +weight: 170 |
5 | 6 | ---
|
6 | 7 |
|
7 | 8 | <!-- overview -->
|
@@ -84,7 +85,7 @@ dnsutils 1/1 Running 0 <some-time>
|
84 | 85 | ```
|
85 | 86 |
|
86 | 87 | <!--
|
87 |
| -Once that pod is running, you can exec `nslookup` in that environment. |
| 88 | +Once that Pod is running, you can exec `nslookup` in that environment. |
88 | 89 | If you see something like the following, DNS is working correctly.
|
89 | 90 | -->
|
90 | 91 | 一旦 Pod 处于运行状态,你就可以在该环境里执行 `nslookup`。
|
@@ -204,17 +205,17 @@ The value for label `k8s-app` is `kube-dns` for both CoreDNS and kube-dns deploy
|
204 | 205 | {{< /note >}}
|
205 | 206 |
|
206 | 207 | <!--
|
207 |
| -If you see that no CoreDNS pod is running or that the pod has failed/completed, |
| 208 | +If you see that no CoreDNS Pod is running or that the Pod has failed/completed, |
208 | 209 | the DNS add-on may not be deployed by default in your current environment and you
|
209 | 210 | will have to deploy it manually.
|
210 | 211 | -->
|
211 | 212 | 如果你发现没有 CoreDNS Pod 在运行,或者该 Pod 的状态是 failed 或者 completed,
|
212 | 213 | 那可能这个 DNS 插件在你当前的环境里并没有成功部署,你将需要手动去部署它。
|
213 | 214 |
|
214 | 215 | <!--
|
215 |
| -### Check for Errors in the DNS pod |
| 216 | +### Check for errors in the DNS pod |
216 | 217 |
|
217 |
| -Use `kubectl logs` command to see logs for the DNS containers. |
| 218 | +Use the `kubectl logs` command to see logs for the DNS containers. |
218 | 219 | -->
|
219 | 220 | ### 检查 DNS Pod 里的错误 {#check-for-errors-in-the-dns-pod}
|
220 | 221 |
|
@@ -308,8 +309,8 @@ kube-dns 10.180.3.17:53,10.180.3.17:53 1h
|
308 | 309 | ```
|
309 | 310 |
|
310 | 311 | <!--
|
311 |
| -If you do not see the endpoints, see endpoints section in the |
312 |
| -[debugging services](/docs/tasks/debug/debug-application/debug-service/) documentation. |
| 312 | +If you do not see the endpoints, see the endpoints section in the |
| 313 | +[debugging Services](/docs/tasks/debug/debug-application/debug-service/) documentation. |
313 | 314 |
|
314 | 315 | For additional Kubernetes DNS examples, see the
|
315 | 316 | [cluster-dns examples](https://github.com/kubernetes/examples/tree/master/staging/cluster-dns)
|
@@ -338,7 +339,7 @@ kubectl -n kube-system edit configmap coredns
|
338 | 339 | ```
|
339 | 340 |
|
340 | 341 | <!--
|
341 |
| -Then add `log` in the Corefile section per the example below. |
| 342 | +Then add `log` in the Corefile section per the example below: |
342 | 343 | -->
|
343 | 344 | 然后按下面的例子给 Corefile 添加 `log`。
|
344 | 345 |
|
@@ -377,7 +378,7 @@ CoreDNS 的 Pod 里。
|
377 | 378 | <!--
|
378 | 379 | Next, make some queries and view the logs per the sections above in this document. If CoreDNS pods are receiving the queries, you should see them in the logs.
|
379 | 380 |
|
380 |
| -Here is an example of a query in the log. |
| 381 | +Here is an example of a query in the log: |
381 | 382 | -->
|
382 | 383 | 接下来,发起一些查询并依照前文所述查看日志信息,如果 CoreDNS 的 Pod 接收到这些查询,
|
383 | 384 | 你将可以在日志信息里看到它们。
|
@@ -504,9 +505,9 @@ To learn more about name resolution, see
|
504 | 505 | <!--
|
505 | 506 | ## Known issues
|
506 | 507 |
|
507 |
| -Some Linux distributions (e.g. Ubuntu), use a local DNS resolver by default (systemd-resolved). |
| 508 | +Some Linux distributions (e.g. Ubuntu) use a local DNS resolver by default (systemd-resolved). |
508 | 509 | Systemd-resolved moves and replaces `/etc/resolv.conf` with a stub file that can cause a fatal forwarding
|
509 |
| -loop when resolving names in upstream servers. This can be fixed manually by using kubelet's `-resolv-conf` flag |
| 510 | +loop when resolving names in upstream servers. This can be fixed manually by using kubelet's `--resolv-conf` flag |
510 | 511 | to point to the correct `resolv.conf` (With `systemd-resolved`, this is `/run/systemd/resolve/resolv.conf`).
|
511 | 512 | kubeadm automatically detects `systemd-resolved`, and adjusts the kubelet flags accordingly.
|
512 | 513 | -->
|
@@ -542,9 +543,9 @@ Linux 的 libc(又名 glibc)默认将 DNS `nameserver` 记录限制为 3,
|
542 | 543 |
|
543 | 544 | <!--
|
544 | 545 | If you are using Alpine version 3.3 or earlier as your base image, DNS may not
|
545 |
| -work properly owing to a known issue with Alpine. |
546 |
| -Check [here](https://github.com/kubernetes/kubernetes/issues/30215) |
547 |
| -for more information. |
| 546 | +work properly due to a known issue with Alpine. |
| 547 | +Kubernetes [issue 30215](https://github.com/kubernetes/kubernetes/issues/30215) |
| 548 | +details more information on this. |
548 | 549 | -->
|
549 | 550 | 如果你使用 Alpine 3.3 或更早版本作为你的基础镜像,DNS 可能会由于 Alpine 中
|
550 | 551 | 一个已知的问题导致无法正常工作。
|
|
0 commit comments