You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 对于无头 Service,该记录会被解析成多个结果,即该 Service 的每个后端 Pod 各一个 SRV 记录,
183
+
其中包含 Pod 端口号和域名,格式为:`hostname.my-svc.my-namespace.svc.cluster-domain.example`。
178
184
179
185
<!--
180
-
## Pods-->
186
+
## Pods
187
+
-->
181
188
## Pod
182
189
183
190
<!--
184
191
### A/AAAA records
185
192
186
-
Kube-DNS versions, prior to the implementation of the [DNS specification](https://github.com/kubernetes/dns/blob/master/docs/specification.md), had the following DNS resolution:
193
+
Kube-DNS versions, prior to the implementation of the
Because A and AAAA records are not created for Pod names, `hostname` is required for the Pod's A or AAAA
330
-
record to be created. A Pod with no `hostname` but with `subdomain` will only create the
345
+
A and AAAA records are not created for Pod names since `hostname` is missing for the Pod.
346
+
A Pod with no `hostname` but with `subdomain` will only create the
331
347
A or AAAA record for the headless Service (`busybox-subdomain.my-namespace.svc.cluster-domain.example`),
332
348
pointing to the Pods' IP addresses. Also, the Pod needs to be ready in order to have a
333
349
record unless `publishNotReadyAddresses=True` is set on the Service.
334
350
-->
335
-
{{< note >}}
336
-
由于 A 和 AAAA 记录不是基于 Pod 名称创建,因此需要设置了 `hostname` 才会生成 Pod 的 A 或 AAAA 记录。
351
+
由于 Pod 缺少 `hostname`,所以没有为这些 Pod 名称创建 A 和 AAAA 记录。
337
352
没有设置 `hostname` 但设置了 `subdomain` 的 Pod 只会为
338
353
无头 Service 创建 A 或 AAAA 记录(`busybox-subdomain.my-namespace.svc.cluster-domain.example`)
339
354
指向 Pod 的 IP 地址。
@@ -351,8 +366,8 @@ record unless `publishNotReadyAddresses=True` is set on the Service.
351
366
<!--
352
367
When a Pod is configured to have fully qualified domain name (FQDN), its
353
368
hostname is the short hostname. For example, if you have a Pod with the fully
354
-
qualified domain name `busybox-1.busybox-subdomain.my-namespace.svc.cluster-domain.example`,
355
-
then by default the `hostname` command inside that Pod returns `busybox-1` and the
369
+
qualified domain name `busybox-1.busybox-subdomain.my-namespace.svc.cluster-domain.example`,
370
+
then by default the `hostname` command inside that Pod returns `busybox-1` and the
356
371
`hostname --fqdn`command returns the FQDN.
357
372
358
373
When you set `setHostnameAsFQDN: true` in the Pod spec, the kubelet writes the Pod's FQDN into the hostname for that Pod's namespace. In this case, both `hostname` and `hostname --fqdn` return the Pod's FQDN.
@@ -369,7 +384,13 @@ When you set `setHostnameAsFQDN: true` in the Pod spec, the kubelet writes the P
369
384
<!--
370
385
In Linux, the hostname field of the kernel (the `nodename` field of `struct utsname`) is limited to 64 characters.
371
386
372
-
If a Pod enables this feature and its FQDN is longer than 64 character, it will fail to start. The Pod will remain in `Pending` status (`ContainerCreating` as seen by `kubectl`) generating error events, such as Failed to construct FQDN from Pod hostname and cluster domain, FQDN `long-FQDN` is too long (64 characters is the max, 70 characters requested). One way of improving user experience for this scenario is to create an [admission webhook controller](/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks) to control FQDN size when users create top level objects, for example, Deployment.
387
+
If a Pod enables this feature and its FQDN is longer than 64 character, it will fail to start.
388
+
The Pod will remain in `Pending` status (`ContainerCreating` as seen by `kubectl`) generating
389
+
error events, such as Failed to construct FQDN from Pod hostname and cluster domain,
390
+
FQDN `long-FQDN` is too long (64 characters is the max, 70 characters requested).
391
+
One way of improving user experience for this scenario is to create an
0 commit comments