指定 default 命名空间下 Pod 名为 frontend-d89756ff7-pbnnc,容器id为 2ff814b246f86,做访问 www.baidu.com 域名异常实验举例。
yaml 配置方式
apiVersion:chaosblade.io/v1alpha1kind:ChaosBlademetadata:name:tamper-container-dns-by-idspec:experiments: - scope:containertarget:networkaction:dnsdesc:"tamper container dns by id"matchers: - name:container-idsvalue: - "4b25f66580c4" - name:domainvalue: ["www.baidu.com"] - name:ipvalue: ["10.0.0.1"]# pod names - name:namesvalue: ["frontend-d89756ff7-trsxf"]# or use pod labels
Q: {"code":504,"success":false,"error":"unexpected status, the real value is Error","result":{"uid":"623841684347c05f","success":false,"error":"unexpected status, the real value is Error","statuses":[{"uid":"4b25f66580c4dbf465a1b167c4c6967e987773442e5d47f0bee5db0a5e27a12d","name":"php-redis","state":"Error","kind":"container","error":"10.0.0.1 www.baidu.com #chaosblade has been exist exit status 1","success":false,"nodeName":"cn-hangzhou.192.168.0.203"}]}} A: 所以实验已经存在