Closed rociomroman closed 7 months ago
Although it's possible to manually derive the kill command based on the application and use it in the experiment, I recommend using pod-cpu-hog instead of pod-cpu-hog-exec. This approach will help avoid such issues.
What happened: We are able to inject the cpu stress, however when terminating, we get the following error log:
What you expected to happen: We expected for the cpu hog exec experiment to terminate with the kill command.
How to reproduce it (as minimally and precisely as possible):
YAML:
Anything else we need to know?: Litmus version 2.7.0
What we've tried: We tried the following kill commands that we found in the documentation for cpu hog exec and different variations: -kill $(find /proc -name exe -lname '/md5sum' 2>&1 | grep -v 'Permission denied' | awk -F/ '{print $(NF-1)}') -kill -9 $(ps afx | grep \"[md5sum] /dev/zero\" | awk '{print$1}' | tr '\n' ' ') -kill -9 $(find /proc -name exe -lname '/md5sum' 2>&1 | grep -v 'Permission denied' | awk -F/ '{print $(NF-1)}') https://litmuschaos.github.io/litmus/experiments/categories/pods/pod-cpu-hog-exec/
Thoughts: Checked out the target container in question and noticed when i shelled in, it didn't have the PS command available. That's probably why this command didn't work:
kill -9 $(ps afx | grep \"[md5sum] /dev/zero\" | awk '{print$1}' | tr '\n' ' ')
However,kill $(find /proc -name exe -lname '*/md5sum' 2>&1 | grep -v 'Permission denied' | awk -F/ '{print $(NF-1)}')
also didn't work but that could be related to the container permissions. In one of the other containers in the app, cpu stress is injected and terminated successfully. The difference was that I did notice that the container had the ability to execute PS commands.Questions: For the kill command to work for cpu stress exec, does it heavily depend on the container image and its varying configurations? as in whether it's able to use the PS command or the find /proc command? Is there a kill command that would support most container images or alternative commands to try out? Any insights are much appreciated. Thank you.
Somewhat similar issue others are having for reference: https://github.com/litmuschaos/litmus/issues/1861