混沌工程实验

时间:2019-06-19 21:26:43

标签: chaos

在一个实验中是否可以对单个动作进行多次迭代?

说我想每隔600秒运行一次terminate-db-pod。

{
    "name": "all-our-microservices-should-be-healthy",
    "type": "probe",
    "tolerance": "true",
    "provider": {
        "type": "python",
        "module": "chaosk8s.probes",
        "func": "microservice_available_and_healthy",
        "arguments": {
            "name": "myapp",
            "ns": "myns"
        }
    }
},
{
    "type": "action",
    "name": "terminate-db-pod",
    "provider": {
        "type": "python",
        "module": "chaosk8s.pod.actions",
        "func": "terminate_pods",
        "arguments": {
            "label_selector": "app=my-app",
            "name_pattern": "my-app-[0-9]$",
            "rand": true,
            "ns": "default"
        }
    },
    "pauses": {
        "after": 5
    }
}

1 个答案:

答案 0 :(得分:0)

您可以使用ref

 { 
  ref: terminate-db-pod,
  type: action 
  }