From 2213bc3da0241ebdded416935bf98cabd4f7fc36 Mon Sep 17 00:00:00 2001 From: windsonsea Date: Sun, 24 Jul 2022 12:11:55 +0800 Subject: [PATCH] [zh-cn] resync /tasks/network/validate-dual-stack.md --- .../docs/tasks/network/validate-dual-stack.md | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/content/zh-cn/docs/tasks/network/validate-dual-stack.md b/content/zh-cn/docs/tasks/network/validate-dual-stack.md index bf490460505ff..a38c206d44733 100644 --- a/content/zh-cn/docs/tasks/network/validate-dual-stack.md +++ b/content/zh-cn/docs/tasks/network/validate-dual-stack.md @@ -24,11 +24,9 @@ This document shares how to validate IPv4/IPv6 dual-stack enabled Kubernetes clu * A [network plugin](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/) that supports dual-stack networking. * [Dual-stack enabled](/docs/concepts/services-networking/dual-stack/) cluster --> -* 提供程序对双协议栈网络的支持 (云供应商或其他方式必须能够为 Kubernetes 节点 - 提供可路由的 IPv4/IPv6 网络接口) -* 一个能够支持[双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/)的 +* 驱动程序对双协议栈网络的支持 (云驱动或其他方式必须能够为 Kubernetes 节点提供可路由的 IPv4/IPv6 网络接口) +* 一个能够支持[双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/)网络的 [网络插件](/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)。 - * [启用双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/) 集群 {{< version-check >}} @@ -79,8 +77,9 @@ Validate that the node has an IPv4 and IPv6 interface detected. Replace node nam 在此示例中,节点名称为 `k8s-linuxpool1-34450317-0`: ```shell -kubectl get nodes k8s-linuxpool1-34450317-0 -o go-template --template='{{range .status.addresses}}{{printf "%s: %s \n" .type .address}}{{end}}' +kubectl get nodes k8s-linuxpool1-34450317-0 -o go-template --template='{{range .status.addresses}}{{printf "%s: %s\n" .type .address}}{{end}}' ``` + ``` Hostname: k8s-linuxpool1-34450317-0 InternalIP: 10.240.0.5 @@ -98,7 +97,7 @@ Validate that a Pod has an IPv4 and IPv6 address assigned. Replace the Pod name 在此示例中,Pod 名称为 `pod01`: ```shell -kubectl get pods pod01 -o go-template --template='{{range .status.podIPs}}{{printf "%s \n" .ip}}{{end}}' +kubectl get pods pod01 -o go-template --template='{{range .status.podIPs}}{{printf "%s\n" .ip}}{{end}}' ``` ``` @@ -204,7 +203,7 @@ spec: protocol: TCP targetPort: 9376 selector: - app: MyApp + app.kubernetes.io/name: MyApp sessionAffinity: None type: ClusterIP status: @@ -241,7 +240,7 @@ apiVersion: v1 kind: Service metadata: labels: - app: MyApp + app.kubernetes.io/name: MyApp name: my-service spec: clusterIP: fd00::5118 @@ -255,7 +254,7 @@ spec: protocol: TCP targetPort: 80 selector: - app: MyApp + app.kubernetes.io/name: MyApp sessionAffinity: None type: ClusterIP status: @@ -279,10 +278,10 @@ The `kubectl get svc` command will only show the primary IP in the `CLUSTER-IP` `kubectl get svc` 命令将仅在 `CLUSTER-IP` 字段中显示主 IP。 ```shell -kubectl get svc -l app=MyApp +kubectl get svc -l app.kubernetes.io/name=MyApp -NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -my-service ClusterIP fe80:20d::d06b 80/TCP 9s +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +my-service ClusterIP 10.0.216.242 80/TCP 5s ``` {{< /note >}} @@ -293,15 +292,15 @@ Validate that the Service gets cluster IPs from the IPv4 and IPv6 address blocks 然后你就可以通过 IP 和端口,验证对服务的访问。 ```shell -kubectl describe svc -l app=MyApp +kubectl describe svc -l app.kubernetes.io/name=MyApp ``` ``` Name: my-service Namespace: default -Labels: app=MyApp +Labels: app.kubernetes.io/name=MyApp Annotations: -Selector: app=MyApp +Selector: app.kubernetes.io/name=MyApp Type: ClusterIP IP Family Policy: PreferDualStack IP Families: IPv4,IPv6 @@ -333,7 +332,7 @@ Check the Service: 检查服务: ```shell -kubectl get svc -l app=MyApp +kubectl get svc -l app.kubernetes.io/name=MyApp ```