制作镜像sdfp2:v1.5,k8s部署Pod:sdfp2-centos.yaml
镜像拷贝5个文件夹,yum安装工具:
cp -r cdatc /home/
cp -r redis /usr/local/
cp -r AirNet /usr/
cp -r ld.so.conf.d /etc/
cp -r lib64/* /usr/lib64/
yum: net-tools iproute tcpdump psmisc sendip traceroute lsof vim
# vim /home/cdatc/AirNet/config/network.xml
<node hostname="k8s-node06" ip_a="192.168.5.50" ip_b=
<node hostname="sdfp2" ip_a="192.168.5.51" i
sdfp2-centos.yaml:
需要持久化到存储的2个日志目录
/home/cdatc/AirNet/bin/log /home/cdatc/AirNet/bin/raw
sshpass容器修改IP,子网掩码不能是32,否则只能ping通自己,改成24:
sshpass -p 123456 ssh -o StrictHostKeyChecking=no root@$MY_NODE_IP "ip addr add 192.168.5.51/24 dev enp4s0f0"
sdfp2启动命令:后续启动脚本加上redis和mnt启动命令,加上privileged: true,否则mnt和在docker中运行一样产生core:
command: ["/usr/sbin/init"]
securityContext:
runAsUser: 0
privileged: true
1、k8s调度到k8s-node06(hostNetwork: true使用宿主机网络),测试:
- pod内测试:组播这里默认使用网卡配置的第一个IP:192.168.31.219
# ip a
2: enp4s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
inet 192.168.31.219/24 brd 192.168.31.255 scope global enp4s0f0
inet 192.168.5.51/24 scope global enp4s0f0
# tcpdump -i enp4s0f0 -nn 'src 192.168.5.51 and dst 225.1.0.1 and port 40001' //没有数据
# tcpdump -i enp4s0f0 -nn 'src 192.168.31.219 and dst 225.1.0.1 and port 40001'
00:52:44.870672 IP 192.168.31.219.22095 > 225.1.0.1.40001: UDP, length 36
——Pod组播使用网卡属于别的网段第一个IP,SMC监控和SDD雷达信号也OK!{因为是“组播业务”},但是该网卡的多个IP中必须存在network.xml指定的IP(192.168.5.51->到组播255.1.0.2;192.168.6.51->到组播255.2.0.2),mid进程由此决定使用不同的组播地址输出,只是组播出来时数据包的源IP会转而使用网卡ens4配置的第一个IP(192.168.31.10)(AirNet迁移到Docker镜像)
# tcpdump -i enp4s0f0 -nn 'src 192.168.31.219 and dst 225.1.0.1 and port 40001'
00:55:51.341778 IP 192.168.31.219.28144 > 225.1.0.1.40001: UDP, length 397
[root@SMC1 all]# tcpdump -i eth0 -nn 'src 192.168.31.219 and dst 225.1.0.1 and port 40001'
01:11:44.361918 IP 192.168.31.219.28144 > 225.1.0.1.40001: UDP, length 397
2、k8s调度到k8s-node06(非hostNetwork: true),测试: