@@ -24,11 +24,9 @@ This document shares how to validate IPv4/IPv6 dual-stack enabled Kubernetes clu
24
24
* A [network plugin](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/) that supports dual-stack networking.
25
25
* [Dual-stack enabled](/docs/concepts/services-networking/dual-stack/) cluster
26
26
-->
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/ ) 网络的
30
29
[ 网络插件] ( /zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/ ) 。
31
-
32
30
* [ 启用双协议栈] ( /zh-cn/docs/concepts/services-networking/dual-stack/ ) 集群
33
31
34
32
{{< version-check >}}
@@ -79,8 +77,9 @@ Validate that the node has an IPv4 and IPv6 interface detected. Replace node nam
79
77
在此示例中,节点名称为 ` k8s-linuxpool1-34450317-0 ` :
80
78
81
79
``` 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}}'
83
81
```
82
+
84
83
```
85
84
Hostname: k8s-linuxpool1-34450317-0
86
85
InternalIP: 10.240.0.5
@@ -98,7 +97,7 @@ Validate that a Pod has an IPv4 and IPv6 address assigned. Replace the Pod name
98
97
在此示例中,Pod 名称为 ` pod01 ` :
99
98
100
99
``` 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}}'
102
101
```
103
102
104
103
```
@@ -204,7 +203,7 @@ spec:
204
203
protocol : TCP
205
204
targetPort : 9376
206
205
selector :
207
- app : MyApp
206
+ app.kubernetes.io/name : MyApp
208
207
sessionAffinity : None
209
208
type : ClusterIP
210
209
status :
@@ -241,7 +240,7 @@ apiVersion: v1
241
240
kind: Service
242
241
metadata:
243
242
labels:
244
- app: MyApp
243
+ app.kubernetes.io/name : MyApp
245
244
name: my-service
246
245
spec:
247
246
clusterIP: fd00::5118
@@ -255,7 +254,7 @@ spec:
255
254
protocol: TCP
256
255
targetPort: 80
257
256
selector:
258
- app: MyApp
257
+ app.kubernetes.io/name : MyApp
259
258
sessionAffinity: None
260
259
type: ClusterIP
261
260
status:
@@ -279,10 +278,10 @@ The `kubectl get svc` command will only show the primary IP in the `CLUSTER-IP`
279
278
` kubectl get svc` 命令将仅在 `CLUSTER-IP` 字段中显示主 IP。
280
279
281
280
` ` ` shell
282
- kubectl get svc -l app=MyApp
281
+ kubectl get svc -l app.kubernetes.io/name =MyApp
283
282
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
286
285
` ` `
287
286
{{< /note >}}
288
287
@@ -293,15 +292,15 @@ Validate that the Service gets cluster IPs from the IPv4 and IPv6 address blocks
293
292
然后你就可以通过 IP 和端口,验证对服务的访问。
294
293
295
294
` ` ` shell
296
- kubectl describe svc -l app=MyApp
295
+ kubectl describe svc -l app.kubernetes.io/name =MyApp
297
296
` ` `
298
297
299
298
```
300
299
Name: my-service
301
300
Namespace: default
302
- Labels: app=MyApp
301
+ Labels: app.kubernetes.io/name =MyApp
303
302
Annotations: <none >
304
- Selector: app=MyApp
303
+ Selector: app.kubernetes.io/name =MyApp
305
304
Type: ClusterIP
306
305
IP Family Policy: PreferDualStack
307
306
IP Families: IPv4,IPv6
@@ -333,7 +332,7 @@ Check the Service:
333
332
检查服务:
334
333
335
334
```shell
336
- kubectl get svc -l app=MyApp
335
+ kubectl get svc -l app.kubernetes.io/name =MyApp
337
336
```
338
337
339
338
<!--
@@ -342,7 +341,7 @@ Validate that the Service receives a `CLUSTER-IP` address from the IPv6 address
342
341
验证服务是否从 IPv6 地址块中接收到 ` CLUSTER-IP ` 地址以及 ` EXTERNAL-IP ` 。
343
342
然后,你可以通过 IP 和端口验证对服务的访问。
344
343
345
- ```
344
+ ``` shell
346
345
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
347
346
my-service LoadBalancer fd00::7ebc 2603:1030:805::5 80:30790/TCP 35s
348
347
```
0 commit comments