k8s测试容器之间是否互通

Posted effortsing

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了k8s测试容器之间是否互通相关的知识,希望对你有一定的参考价值。

[[email protected] .kube]# kubectl get pod -o wide
NAME                     READY     STATUS    RESTARTS   AGE       IP           NODE
curl-87b54756-rbqzg      1/1       Running   1          41m       10.244.0.5   192.168.43.82
nginx-5dbb4c75cd-8jcpp   1/1       Running   0          45m       10.244.1.4   192.168.43.83
nginx-5dbb4c75cd-bz9j8   1/1       Running   0          45m       10.244.1.3   192.168.43.83
nginx-5dbb4c75cd-mbqbh   1/1       Running   0          45m       10.244.0.4   192.168.43.82


[[email protected] .kube]# kubectl exec -it curl-87b54756-rbqzg sh
[ [email protected]-87b54756-rbqzg:/ ]$ ping 192.168.43.83
PING 192.168.43.83 (192.168.43.83): 56 data bytes
64 bytes from 192.168.43.83: seq=0 ttl=63 time=7.055 ms
64 bytes from 192.168.43.83: seq=1 ttl=63 time=0.897 ms





[[email protected] .kube]# kubectl exec -it nginx-5dbb4c75cd-bz9j8 sh
/ # ping 10.244.1.4
PING 10.244.1.4 (10.244.1.4): 56 data bytes
64 bytes from 10.244.1.4: seq=0 ttl=64 time=0.601 ms
64 bytes from 10.244.1.4: seq=1 ttl=64 time=0.102 ms
64 bytes from 10.244.1.4: seq=2 ttl=64 time=0.116 ms
^C

 

以上是关于k8s测试容器之间是否互通的主要内容,如果未能解决你的问题,请参考以下文章

解决flannel下k8s pod及容器无法跨主机互通问题

容器之间的互通

#云原生征文#Kubernetes(k8s)网络

精句k8s资源管理概述

docker容器之间网络互通

16.kubernetes笔记 CNI网络插件(二) Calico介绍