[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.
* [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 <none> 80/TCP 9s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
my-service ClusterIP 10.0.216.242 <none> 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: <none>
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
```
<!--
@@ -342,7 +341,7 @@ Validate that the Service receives a `CLUSTER-IP` address from the IPv6 address
验证服务是否从 IPv6 地址块中接收到 `CLUSTER-IP` 地址以及 `EXTERNAL-IP`
然后,你可以通过 IP 和端口验证对服务的访问。
```
```shell
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
my-service LoadBalancer fd00::7ebc 2603:1030:805::5 80:30790/TCP 35s
```