mirror of
https://github.com/krkn-chaos/krkn.git
synced 2026-02-14 18:10:00 +00:00
Add pod scenarios for custom app
Signed-off-by: mjulie <mjulie@in.ibm.com>
This commit is contained in:
committed by
Naga Ravi Chaitanya Elluri
parent
9df350a189
commit
488aa826e4
@@ -4,7 +4,7 @@ Kraken consumes [Powerfulseal](https://github.com/powerfulseal/powerfulseal) und
|
||||
|
||||
#### Pod chaos scenarios
|
||||
Following are the components of Kubernetes/OpenShift for which a basic chaos scenario config exists today. Adding a new pod based scenario is as simple as adding a new config under scenarios directory and defining it in the config.
|
||||
For example, for adding a pod level scenario for a custom application, refer to the sample scenario (customapp_pod.yaml and post_action_customapp_pod.py) provided in the scenarios directory.
|
||||
For example, for adding a pod level scenario for a custom application, refer to the sample scenario (customapp_pod.yaml) provided in the scenarios directory.
|
||||
|
||||
Component | Description | Working
|
||||
------------------------ | ---------------------------------------------------------------------------------------------------| ------------------------- |
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import subprocess
|
||||
import logging
|
||||
|
||||
|
||||
def run(cmd):
|
||||
try:
|
||||
output = subprocess.Popen(cmd, shell=True,
|
||||
universal_newlines=True, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
(out, err) = output.communicate()
|
||||
logging.info("out " + str(out))
|
||||
except Exception as e:
|
||||
logging.error("Failed to run %s, error: %s" % (cmd, e))
|
||||
return out
|
||||
|
||||
|
||||
pods_running = run("oc get pods -n acme-air | grep -c Running").rstrip()
|
||||
|
||||
if pods_running == str(8):
|
||||
print("There were 8 pods running properly")
|
||||
else:
|
||||
print("ERROR there were " + str(pods_running) + " pods running instead of 8")
|
||||
Reference in New Issue
Block a user