@@ -30,6 +30,13 @@ kube-dns.
30
30
<!--
31
31
### Create a simple Pod to use as a test environment
32
32
33
+ {{< codenew file="admin/dns/dnsutils.yaml" >}}
34
+
35
+ {{< note >}}
36
+ This example creates a pod in the `default` namespace. DNS name resolution for
37
+ services depends on the namespace of the pod. For more information, review
38
+ [DNS for Services and Pods](/docs/concepts/services-networking/dns-pod-service/#what-things-get-dns-names).
39
+ {{< /note >}}
33
40
34
41
Use that manifest to create a Pod:
35
42
@@ -46,6 +53,11 @@ busybox 1/1 Running 0 <some-time>
46
53
47
54
{{< codenew file="admin/dns/dnsutils.yaml" >}}
48
55
56
+ {{< note >}}
57
+ 此示例在 ` default ` 命名空间创建 pod。 服务的 DNS 名字解析取决于 pod 的命名空间。 详细信息请查阅
58
+ [ 服务和 Pod 的 DNS] ( /zh/docs/concepts/services-networking/dns-pod-service/#what-things-get-dns-names ) 。
59
+ {{< /note >}}
60
+
49
61
使用上面的清单来创建一个 Pod:
50
62
51
63
``` shell
@@ -364,6 +376,49 @@ linux/amd64, go1.10.3, 2e322f6
364
376
365
377
```
366
378
379
+ <!--
380
+ ### Are you in the right namespace for the service?
381
+
382
+ DNS queries that don't specify a namespace are limited to the pod's
383
+ namespace.
384
+
385
+ If the namespace of the pod and service differ, the DNS query must include
386
+ the namespace of the service.
387
+
388
+ This query is limited to the pod's namespace:
389
+ ```shell
390
+ kubectl exec -i -t dnsutils -- nslookup <service-name>
391
+ ```
392
+ -->
393
+ ### 你的服务在正确的命名空间中吗?
394
+
395
+ 未指定命名空间的 DNS 查询仅作用于 pod 所在的命名空间。
396
+
397
+ 如果 pod 和服务的命名空间不相同,则 DNS 查询必须指定服务所在的命名空间。
398
+
399
+ 该查询仅限于 pod 所在的名称空间:
400
+ ``` shell
401
+ kubectl exec -i -t dnsutils -- nslookup < service-name>
402
+ ```
403
+
404
+ <!--
405
+ This query specifies the namespace:
406
+ ```shell
407
+ kubectl exec -i -t dnsutils -- nslookup <service-name>.<namespace>
408
+ ```
409
+ -->
410
+ 指定命名空间的查询:
411
+ ``` shell
412
+ kubectl exec -i -t dnsutils -- nslookup < service-name> .< namespace>
413
+ ```
414
+
415
+ <!--
416
+ To learn more about name resolution, see
417
+ [DNS for Services and Pods](/docs/concepts/services-networking/dns-pod-service/#what-things-get-dns-names).
418
+ -->
419
+ 要进一步了解名字解析,请查看
420
+ [ 服务和 Pod 的 DNS] ( /zh/docs/concepts/services-networking/dns-pod-service/#what-things-get-dns-names ) 。
421
+
367
422
<!--
368
423
## Known issues
369
424
0 commit comments