Skip to content

Commit 2213bc3

Browse files
committed
[zh-cn] resync /tasks/network/validate-dual-stack.md
1 parent 4b435b4 commit 2213bc3

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

content/zh-cn/docs/tasks/network/validate-dual-stack.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ This document shares how to validate IPv4/IPv6 dual-stack enabled Kubernetes clu
2424
* A [network plugin](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/) that supports dual-stack networking.
2525
* [Dual-stack enabled](/docs/concepts/services-networking/dual-stack/) cluster
2626
-->
27-
* 提供程序对双协议栈网络的支持 (云供应商或其他方式必须能够为 Kubernetes 节点
28-
提供可路由的 IPv4/IPv6 网络接口)
29-
* 一个能够支持[双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/)
27+
* 驱动程序对双协议栈网络的支持 (云驱动或其他方式必须能够为 Kubernetes 节点提供可路由的 IPv4/IPv6 网络接口)
28+
* 一个能够支持[双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/)网络的
3029
[网络插件](/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)
31-
3230
* [启用双协议栈](/zh-cn/docs/concepts/services-networking/dual-stack/) 集群
3331

3432
{{< version-check >}}
@@ -79,8 +77,9 @@ Validate that the node has an IPv4 and IPv6 interface detected. Replace node nam
7977
在此示例中,节点名称为 `k8s-linuxpool1-34450317-0`
8078

8179
```shell
82-
kubectl get nodes k8s-linuxpool1-34450317-0 -o go-template --template='{{range .status.addresses}}{{printf "%s: %s \n" .type .address}}{{end}}'
80+
kubectl get nodes k8s-linuxpool1-34450317-0 -o go-template --template='{{range .status.addresses}}{{printf "%s: %s\n" .type .address}}{{end}}'
8381
```
82+
8483
```
8584
Hostname: k8s-linuxpool1-34450317-0
8685
InternalIP: 10.240.0.5
@@ -98,7 +97,7 @@ Validate that a Pod has an IPv4 and IPv6 address assigned. Replace the Pod name
9897
在此示例中,Pod 名称为 `pod01`
9998

10099
```shell
101-
kubectl get pods pod01 -o go-template --template='{{range .status.podIPs}}{{printf "%s \n" .ip}}{{end}}'
100+
kubectl get pods pod01 -o go-template --template='{{range .status.podIPs}}{{printf "%s\n" .ip}}{{end}}'
102101
```
103102

104103
```
@@ -204,7 +203,7 @@ spec:
204203
protocol: TCP
205204
targetPort: 9376
206205
selector:
207-
app: MyApp
206+
app.kubernetes.io/name: MyApp
208207
sessionAffinity: None
209208
type: ClusterIP
210209
status:
@@ -241,7 +240,7 @@ apiVersion: v1
241240
kind: Service
242241
metadata:
243242
labels:
244-
app: MyApp
243+
app.kubernetes.io/name: MyApp
245244
name: my-service
246245
spec:
247246
clusterIP: fd00::5118
@@ -255,7 +254,7 @@ spec:
255254
protocol: TCP
256255
targetPort: 80
257256
selector:
258-
app: MyApp
257+
app.kubernetes.io/name: MyApp
259258
sessionAffinity: None
260259
type: ClusterIP
261260
status:
@@ -279,10 +278,10 @@ The `kubectl get svc` command will only show the primary IP in the `CLUSTER-IP`
279278
`kubectl get svc` 命令将仅在 `CLUSTER-IP` 字段中显示主 IP。
280279

281280
```shell
282-
kubectl get svc -l app=MyApp
281+
kubectl get svc -l app.kubernetes.io/name=MyApp
283282
284-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
285-
my-service ClusterIP fe80:20d::d06b <none> 80/TCP 9s
283+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
284+
my-service ClusterIP 10.0.216.242 <none> 80/TCP 5s
286285
```
287286
{{< /note >}}
288287

@@ -293,15 +292,15 @@ Validate that the Service gets cluster IPs from the IPv4 and IPv6 address blocks
293292
然后你就可以通过 IP 和端口,验证对服务的访问。
294293

295294
```shell
296-
kubectl describe svc -l app=MyApp
295+
kubectl describe svc -l app.kubernetes.io/name=MyApp
297296
```
298297

299298
```
300299
Name: my-service
301300
Namespace: default
302-
Labels: app=MyApp
301+
Labels: app.kubernetes.io/name=MyApp
303302
Annotations: <none>
304-
Selector: app=MyApp
303+
Selector: app.kubernetes.io/name=MyApp
305304
Type: ClusterIP
306305
IP Family Policy: PreferDualStack
307306
IP Families: IPv4,IPv6
@@ -333,7 +332,7 @@ Check the Service:
333332
检查服务:
334333
335334
```shell
336-
kubectl get svc -l app=MyApp
335+
kubectl get svc -l app.kubernetes.io/name=MyApp
337336
```
338337

339338
<!--
@@ -342,7 +341,7 @@ Validate that the Service receives a `CLUSTER-IP` address from the IPv6 address
342341
验证服务是否从 IPv6 地址块中接收到 `CLUSTER-IP` 地址以及 `EXTERNAL-IP`
343342
然后,你可以通过 IP 和端口验证对服务的访问。
344343

345-
```
344+
```shell
346345
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
347346
my-service LoadBalancer fd00::7ebc 2603:1030:805::5 80:30790/TCP 35s
348347
```

0 commit comments

Comments
 (0)