Skip to content

Commit

Permalink
Adding regularly used scripts to this repo in a formal way (stolostro…
Browse files Browse the repository at this point in the history
…n#132)

* Adding regularly used scripts to this repo in a formal way

Signed-off-by: Joydeep Banerjee <[email protected]>

* Adding regularly used scripts to this repo in a formal way

Signed-off-by: Joydeep Banerjee <[email protected]>

---------

Signed-off-by: Joydeep Banerjee <[email protected]>
  • Loading branch information
bjoydeep authored Aug 30, 2023
1 parent 0876d88 commit e7ba221
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Tools

This directory has scripts and other utilites to help in your Search journey

1. This [script](postgres-debug.sh) collects data from the Postgres instance to help debug issues with the RHACM search service.
1. This [script](/resource-extractor.sh) collects the number of different kubernetes resources running on a cluster. If there are `x` number of manager clusters of this size going to the connect to a ACM Hub, this data can be used to simulate loading on the search service in ACM Hub.
File renamed without changes.
15 changes: 15 additions & 0 deletions tools/resource-extractor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# HOW TO RUN THIS SCRIPT:
# Log into the Managed Cluster with "oc login --server='' --token='' "
# ./resource-extractor.sh

# DESCRIPTION:
# This script collects the number of different kubernetes resources running on a cluster.

kinds=( $(oc api-resources --no-headers --verbs='watch','list' | awk '{print $1;}') )
declare kinds >> /dev/null
for i in "${kinds[@]}"
do
echo "$(oc get ${i} --all-namespaces --ignore-not-found | wc -l) - ${i}"
done

0 comments on commit e7ba221

Please sign in to comment.