chaos mesh模拟网络故障yaml如例:
kind: NetworkChaos
apiVersion: chaos-mesh.org/v1alpha1
metadata:
namespace: default
name: network-delay
annotations:
experiment.chaos-mesh.org/pause: 'false'
spec:
selector:
namespaces:
- default
labelSelectors:
app: web-show
mode: all
action: delay
duration: 30s
delay:
latency: 10ms
correlation: '0'
jitter: 0ms
direction: to
issue 1:
模拟网络延迟故障时chaosmesh前端报错:
Failed to apply chaos: fialed to apply for pod default/web-show-5c59959996-hcjbr: unable to flush ip sets for pod

查看应用所在节点的deamon所报的错:
Daemon throws an error similar to version 1.41 is too new. The maximum supported API version is 1.40
(此问题仅在runtime为docker时遇到,runtime为container时未遇到。)
解决方法:
使用helm安装时候后面加上--set chaosDaemon.env.DOCKER_API_VERSION=1.39
例:helm upgrade chaosmesh ./ --set chaosDaemon.env.DOCKER_API_VERSION=1.40 -n chaosmesh
issue 2:
模拟网络延迟故障时chaosmesh前端报错:
unable to set tcs for pod ……

查看应用所在节点的deamon所报的错:
Error: Specified qdisc not found
解决方法:
qdiscs 作为内核模块在名为 kernel-modules-extra 的包中提供,需要安装内核:
yum -y install kernel-modules-extra
如果还是报该错,需要查看自己当前的内核版本,然后去网上下载对应内核版本的kernel-modules-extra rpm包
# uname -a
Linux xxxxx 4.18.0-372.13.1.el8_6.x86_64 #1 SMP Mon Jun 6 15:05:22 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
我现在的内核版本为4.18.0-372.13.1,去网站https://almalinux.pkgs.org/找到对应内核的kernel-modules-extra rpm并下载,如:https://almalinux.pkgs.org/8/almalinux-baseos-x86_64/kernel-modules-extra-4.18.0-372.13.1.el8_6.x86_64.rpm.html。
~# https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/Packages/kernel-modules-extra-4.18.0-372.13.1.el8_6.x86_64.rpm
~# yum localinstall kernel-modules-extra-4.18.0-372.13.1.el8_6.x86_64.rpm
再运行一下实验,没有错误了。

网友评论