[zh-cn] resync /tasks/network/validate-dual-stack.md

This commit is contained in:
windsonsea
2022-07-24 12:11:55 +08:00
parent 4b435b453b
commit 2213bc3da0
@@ -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. * 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 * [Dual-stack enabled](/docs/concepts/services-networking/dual-stack/) cluster
--> -->
* 提供程序对双协议栈网络的支持 (云供应商或其他方式必须能够为 Kubernetes 节点 * 驱动程序对双协议栈网络的支持 (云驱动或其他方式必须能够为 Kubernetes 节点提供可路由的 IPv4/IPv6 网络接口)
提供可路由的 IPv4/IPv6 网络接口) * 一个能够支持[双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/)网络的
* 一个能够支持[双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/)的
[网络插件](/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)。 [网络插件](/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)。
* [启用双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/) 集群 * [启用双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/) 集群
{{< version-check >}} {{< version-check >}}
@@ -81,6 +79,7 @@ Validate that the node has an IPv4 and IPv6 interface detected. Replace node nam
```shell ```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 Hostname: k8s-linuxpool1-34450317-0
InternalIP: 10.240.0.5 InternalIP: 10.240.0.5
@@ -204,7 +203,7 @@ spec:
protocol: TCP protocol: TCP
targetPort: 9376 targetPort: 9376
selector: selector:
app: MyApp app.kubernetes.io/name: MyApp
sessionAffinity: None sessionAffinity: None
type: ClusterIP type: ClusterIP
status: status:
@@ -241,7 +240,7 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
labels: labels:
app: MyApp app.kubernetes.io/name: MyApp
name: my-service name: my-service
spec: spec:
clusterIP: fd00::5118 clusterIP: fd00::5118
@@ -255,7 +254,7 @@ spec:
protocol: TCP protocol: TCP
targetPort: 80 targetPort: 80
selector: selector:
app: MyApp app.kubernetes.io/name: MyApp
sessionAffinity: None sessionAffinity: None
type: ClusterIP type: ClusterIP
status: 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。 `kubectl get svc` 命令将仅在 `CLUSTER-IP` 字段中显示主 IP。
```shell ```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 NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
my-service ClusterIP fe80:20d::d06b <none> 80/TCP 9s my-service ClusterIP 10.0.216.242 <none> 80/TCP 5s
``` ```
{{< /note >}} {{< /note >}}
@@ -293,15 +292,15 @@ Validate that the Service gets cluster IPs from the IPv4 and IPv6 address blocks
然后你就可以通过 IP 和端口,验证对服务的访问。 然后你就可以通过 IP 和端口,验证对服务的访问。
```shell ```shell
kubectl describe svc -l app=MyApp kubectl describe svc -l app.kubernetes.io/name=MyApp
``` ```
``` ```
Name: my-service Name: my-service
Namespace: default Namespace: default
Labels: app=MyApp Labels: app.kubernetes.io/name=MyApp
Annotations: <none> Annotations: <none>
Selector: app=MyApp Selector: app.kubernetes.io/name=MyApp
Type: ClusterIP Type: ClusterIP
IP Family Policy: PreferDualStack IP Family Policy: PreferDualStack
IP Families: IPv4,IPv6 IP Families: IPv4,IPv6
@@ -333,7 +332,7 @@ Check the Service:
检查服务: 检查服务:
```shell ```shell
kubectl get svc -l app=MyApp kubectl get svc -l app.kubernetes.io/name=MyApp
``` ```
<!-- <!--
@@ -342,7 +341,7 @@ Validate that the Service receives a `CLUSTER-IP` address from the IPv6 address
验证服务是否从 IPv6 地址块中接收到 `CLUSTER-IP` 地址以及 `EXTERNAL-IP` 验证服务是否从 IPv6 地址块中接收到 `CLUSTER-IP` 地址以及 `EXTERNAL-IP`
然后,你可以通过 IP 和端口验证对服务的访问。 然后,你可以通过 IP 和端口验证对服务的访问。
``` ```shell
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
my-service LoadBalancer fd00::7ebc 2603:1030:805::5 80:30790/TCP 35s my-service LoadBalancer fd00::7ebc 2603:1030:805::5 80:30790/TCP 35s
``` ```