Skip to content

Commit

Permalink
Merge branch 'krkn-chaos:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tsebastiani authored Jan 14, 2025
2 parents 0106d6d + be6c33f commit 3f317d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 11 additions & 5 deletions chaos-recommender/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ source $ROOT_FOLDER/common_run.sh
[ -z "$PROMETHEUS_TOKEN" ] && echo "error: PROMETHEUS_TOKEN not set, run the recommender \
with the -e PROMETHEUS_TOKEN=<prometheus_token> option" && exit 1

#checks
#config_setup
[ -z "$THRESHOLD" ] && echo "error: THRESHOLD not set, run the recommender \
with the -e THRESHOLD=<threshold, for example 0.7> option" && exit 1

[ -z "$CPU_THRESHOLD" ] && echo "error: CPU_THRESHOLD not set, run the recommender \
with the -e CPU_THRESHOLD=<cpu_threshold, for example 0.5> option" && exit 1

[ -z "$MEMORY_THRESHOLD" ] && echo "error: MEMORY_THRESHOLD not set, run the recommender \
with the -e MEMORY_THRESHOLD=<memory_threshold, for example 0.5> option" && exit 1

# Run Kraken
cd $KRAKEN_FOLDER
Expand All @@ -42,7 +48,7 @@ python3.9 utils/chaos_recommender/chaos_recommender.py \
-p $PROMETHEUS_ENDPOINT \
-t $PROMETHEUS_TOKEN \
-s $SCRAPE_DURATION \
--threshold $THRESHOLD \
--cpu-threshold $CPU_THRESHOLD \
--mem-threshold $MEMORY_THRESHOLD \
-L $LOG_LEVEL



3 changes: 3 additions & 0 deletions docs/chaos-recommender.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ Parameter | Description
NAMESPACE | Targeted namespace in the cluster
PROMETHEUS_ENDPOINT | Prometheus API endpoint in the cluster to gather telemetry data
PROMETHEUS_TOKEN | Prometheus API Token (usually matches with OCP token)
THRESHOLD | Threshold to compare and determine the outliers, for example 0.7 i.e 70%
CPU_THRESHOLD | CPU threshold to compare with the cpu limits, for example 0.5 i.e 50%
MEMORY_THRESHOLD | Memory threshold to compare with the memory limits, for example 0.5 i.e 50%

*TIP:* to collect prometheus endpoint and token from your OpenShift cluster you can run the following commands:
```
Expand Down

0 comments on commit 3f317d3

Please sign in to comment.