Skip to content

Commit

Permalink
Have a config in the chaos_recommender dir (#615)
Browse files Browse the repository at this point in the history
This will make it easy for the users to find, configure and run it.

Signed-off-by: Naga Ravi Chaitanya Elluri <[email protected]>
  • Loading branch information
chaitanyaenr authored May 13, 2024
1 parent 3fe22a0 commit 58d5d1d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
10 changes: 5 additions & 5 deletions utils/chaos_recommender/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ This tool profiles an application and gathers telemetry data such as CPU, Memory
## Pre-requisites

- Openshift Or Kubernetes Environment where the application is hosted
- Access to the telemetry data via the exposed Prometheus endpoint
- Python3
- Access to the metrics via the exposed Prometheus endpoint
- Python3.9

## Usage

Expand All @@ -22,14 +22,14 @@ This tool profiles an application and gathers telemetry data such as CPU, Memory
$ pip3 install -r requirements.txt
Edit configuration file:
$ vi config/recommender_config.yaml
$ python3.9 utils/chaos_recommender/chaos_recommender.py
$ python3.9 utils/chaos_recommender/chaos_recommender.py -c utils/chaos_recommender/recommender_config.yaml
```
2. Follow the prompts to provide the required information.
## Configuration
To run the recommender with a config file specify the config file path with the `-c` argument.
You can customize the default values by editing the `krkn/config/recommender_config.yaml` file. The configuration file contains the following options:
You can customize the default values by editing the `recommender_config.yaml` file. The configuration file contains the following options:
- `application`: Specify the application name.
- `namespaces`: Specify the namespaces names (separated by coma or space). If you want to profile
Expand Down Expand Up @@ -115,6 +115,6 @@ You can customize the thresholds and options used for data analysis and identify
## Additional Files
- `config/recommender_config.yaml`: The configuration file containing default values for application, namespace, labels, and kubeconfig.
- `recommender_config.yaml`: The configuration file containing default values for application, namespace, labels, and kubeconfig.
Happy Chaos!
35 changes: 35 additions & 0 deletions utils/chaos_recommender/recommender_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
application: openshift-etcd
namespaces: openshift-etcd
labels: app=openshift-etcd
kubeconfig: ~/.kube/config.yaml
prometheus_endpoint: <Prometheus_Endpoint>
auth_token: <Auth_Token>
scrape_duration: 10m
chaos_library: "kraken"
log_level: INFO
json_output_file: False
json_output_folder_path:

# for output purpose only do not change if not needed
chaos_tests:
GENERIC:
- pod_failure
- container_failure
- node_failure
- zone_outage
- time_skew
- namespace_failure
- power_outage
CPU:
- node_cpu_hog
NETWORK:
- application_outage
- node_network_chaos
- pod_network_chaos
MEM:
- node_memory_hog
- pvc_disk_fill

threshold: .7
cpu_threshold: .5
mem_threshold: .5

0 comments on commit 58d5d1d

Please sign in to comment.