记一次网络故障——pod间无法通信
一、背景
- 集群是二进制部署
- 部署完成后一起正常,各种资源对象均可正常创建、
- 部署应用后发现无法跨节点通信,且pod的ip都是172.17.0.0段的
二、排查过程层
- 查看节点路由,发现docker0网卡居然是172.17.0.0段(what?)
- 查找如下资料:基于docker的CNM部署flanel时,需要将/run/flannel/subnet.env作为docker的环境变量,且启动时指定flannel的网段信息
三、解决方案(修改配置文件:/usr/lib/systemd/system/docker.service)
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket [Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
EnvironmentFile=/run/flannel/subnet.env
ExecStart=/usr/bin/dockerd $DOCKER_NETWORK_OPTIONS -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=
RestartSec=
Restart=always # Note that StartLimit* options were moved from "Service" to "Unit" in systemd .
# Both the old, and new location are accepted by systemd and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst= # Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd .
# Both the old, and new name are accepted by systemd and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s # Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity # Comment TasksMax if your systemd version does not supports it.
# Only systemd and above support this option.
TasksMax=infinity # set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes # kill only the docker process, not all processes in the cgroup
KillMode=process [Install]
WantedBy=multi-user.target
调用/run/flannel/subnet.env中的DOCKER_NETWORK_OPTIONS指定pod的网段信息
四、补充
- CNI中,docker0的ip与Pod无关,Pod总是生成的时候才去动态的申请自己的IP
- CNM模式下,Pod的网段在docker engine启动时就已经决定
- 推荐使用CNI模式
参考地址:https://jiayi.space/post/kubernetescong-ru-men-dao-fang-qi-3-wang-luo-yuan-li
记一次网络故障——pod间无法通信的更多相关文章
- 记一次诡异的网络故障排除 - tpc_tw_recycle参数引起的网络故障
一.故障现象 我们团队访问腾讯云上部署的测试环境中的Web系统A时,偶尔会出现类似于网络闪断的情况,浏览器卡很久没有反应,最终报Connection Timeout. 不过奇怪的是,当团队中的某个人无 ...
- 解Bug之路-记一次存储故障的排查过程
解Bug之路-记一次存储故障的排查过程 高可用真是一丝细节都不得马虎.平时跑的好好的系统,在相应硬件出现故障时就会引发出潜在的Bug.偏偏这些故障在应用层的表现稀奇古怪,很难让人联想到是硬件出了问题, ...
- 云平台将故障Pod流量下线通用思路与OpenShift操作实战
1 写在前边 自从公司项目前年上了 OpenShift 3.9 私有云平台,更新部署程序的确变得更加容易了.但是带来了很多复杂性,运维实施人员的学习曲线也陡然上升. 上云之前:在项目没上容器云的早期, ...
- 坑爹坑娘坑祖宗的87端口(记一次tomcat故障排查)
原贴如下 坑爹坑娘坑祖宗的87端口(记一次tomcat故障排查) 虽然我用的是PHPstudy部署的dedecms,还是一样栽倒这个坑里了. 总结经验:本地测试使用8000~9000的端口比较安全.
- c++ 网络编程(三) LINUX/windows 进程间的通信原理与实现代码 基于多进程的服务端实现
原文作者:aircraft 原文链接:https://www.cnblogs.com/DOMLX/p/9613027.html 锲子:进程与线程是什么,他们的区别在哪里: 1 进程概念 进程是程序的一 ...
- IEEP部署企业级网络工程-网络故障-环路故障
网络故障 1.环路故障 概念 1).以太网是一个支持广播的网络, 在没有环路的环境中,广播报文在网络中以泛洪的形式被送达到网络的第一个角落,以保证每个设备都能够接受到它.每台二层设备在接收到广播报文以 ...
- React Native 在用户网络故障时自动调取缓存
App往往都有缓存功能,例如常见的新闻类应用,如果你关闭网络,你上次打开App加载的数据还在,只是不能加载新的数据了. 我的博客bougieblog.cn,欢迎前来尬聊. 集中处理请求 如果你fetc ...
- ZK 网络故障应对法
网络故障可以说是分布式系统天生的宿敌.如果永远不发生网络故障,我们实际上可以设计出高可用强一致的分布式系统.可惜的是不发生网络故障的分布式环境还不存在,ZK 使用过程中也需要小心的应付网络故障. 让我 ...
- traceroute排查网络故障 www.qq.com排查网络故障网络不通 先ping自己
网络不通 先ping自己 在ping网关 再ping外网 再ping别人的ip 背景需求 Linux 因为其强大的网络处理能力,被广泛用于网关(实例链接)和服务器(实例链接).实际工作中,快速排查这些 ...
随机推荐
- 用友 U9 常用的东西
系统资源 数据字典 UI组件 UI参照组件 BE组件 BP组件 SV组件
- 【开发笔记】- 输出String字符串使其文本对齐
需求 一段文本做每64个字节换行处理,并添加对应的头尾注释 代码实现 public static String certFormat(String code, String beginTitle, S ...
- C# 实体对象作为参数统一去除空格
/** * ------------------------------------------------------------------------------ * @Copyright in ...
- sqli-libs笔记Page-1(Basic Challenges)
0X00:前言 sqli-libs是一个学习SQL注入的开源平台,共有75中不同类型的注入.源码可到github上搜索sqli-libs找到 0X01:Page-1基础挑战 0X02:每一关的payl ...
- PHP查询附近的人及其距离的实现方法
1.附近的人 //获取该点周围的4个点 $distance = 1;//范围(单位千米) $lat = 113.873643; $lng = 22.573969; define('EARTH_RADI ...
- k8s dashboard 解决secret自建证书导致浏览器访问限制
解决参考: https://www.jianshu.com/p/c6d560d12d50 熟悉dashboard yaml文件所创建的资源 wget https://raw.githubuserc ...
- msyql error: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
mysql> use mydb Reading table information for completion of table and column names You can turn o ...
- Nginx应用详解及配置
一.Nginx简介 概述:Nginx是一款由俄罗斯开发的开源的高性能HTTP服务器和反向代理服务器,同时支持IMAP/POP3/SMTP代理服务,其性能优势着为显著,官网上称:单台nginx服务器可以 ...
- 大数据技术原理与应用:【第二讲】大数据处理架构Hadoop
2.1 Hadoop概论 创始人:Doug Cutting 1.简介: 开源免费; 操作简单,极大降低使用的复杂性; Hadoop是Java开发的; 在Hadoop上开发应用支持多种编程语言.不限于J ...
- 用 np.logspace() 创建等比数列
np.logspace( start, stop, num=50, endpoint=True, base=10.0, dtype=None, axis=0, ) Docstring: Return ...