chaosblade-io / chaosblade

An easy to use and powerful chaos engineering experiment toolkit.(阿里巴巴开源的一款简单易用、功能强大的混沌实验注入工具)
https://chaosblade.io
Apache License 2.0
5.96k stars 946 forks source link

In a container environment, the image may not have a "ps" command (such as the amazoncorretto image), so I cannot use commands such as "blade create docker process kill" for chaos testing #319

Closed x22x22 closed 4 years ago

x22x22 commented 4 years ago

Issue Description

Type: bug report

Describe what happened

In a container environment, the image may not have a "ps" command (such as the amazoncorretto image), so I cannot use commands such as "blade create docker process kill" for chaos testing

Solution

I recommend introducing https://github.com/directly/mitchellh/go-ps or https://github.com/shirou/gopsutil to solve this problem, if you agree, I can contribute code, thank you

xcaspar commented 4 years ago

@x22x22 The current execution method of the killing process is to copy the chaosblade toolkit to the container for execution, so it is strongly dependent on commands such as ps. We can use the sidecar mode to run a container containing the chaosblade tool, reuse the pid namespace of the target container, and kill processes in the target container by the sidecar container, Similar to network scenarios.

x22x22 commented 4 years ago

@xcaspar I have looked at the source code before asking the question, and I know why this problem occurs. I mainly want to discuss the solution, I want to use "go-ps" or "gopsutil" to solve this problem, because they are directly calling the system's api to obtain the process Information. I wonder if you think it is feasible?

xcaspar commented 4 years ago

@x22x22 That is also a good solution, I think there is no problem. I assign the issue to you, thank you.