Skip to content

Commit

Permalink
Extend control show-tech script
Browse files Browse the repository at this point in the history
Signed-off-by: Pau Capdevila <[email protected]>
  • Loading branch information
pau-hedgehog committed Jan 10, 2025
1 parent 699c051 commit 8dada31
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pkg/hhfab/show-tech/control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,29 @@ df -h >> "$OUTPUT_FILE"
echo -e "\n=== Running Processes ===" >> "$OUTPUT_FILE"
ps aux >> "$OUTPUT_FILE"

# Get custom resources

echo -e "\n=== Githedgehog.com Resources ===" >> "$OUTPUT_FILE"

crds_githedgehog=$(kubectl get crds -o custom-columns=":metadata.name" | grep 'githedgehog.com')

for crd in $crds_githedgehog; do
echo -e "\n=== Instances of $crd ===" >> "$OUTPUT_FILE"
kubectl get $crd -A >> "$OUTPUT_FILE" 2>/dev/null
done

resources_githedgehog=$(kubectl api-resources --verbs=list --namespaced=true -o name | grep 'githedgehog.com')

for resource in $resources_githedgehog; do
echo -e "\n=== Instances of $resource ===" >> "$OUTPUT_FILE"
kubectl get $resource -A >> "$OUTPUT_FILE" 2>/dev/null
done

resources_non_namespaced_githedgehog=$(kubectl api-resources --verbs=list --namespaced=false -o name | grep 'githedgehog.com')

for resource in $resources_non_namespaced_githedgehog; do
echo -e "\n=== Instances of $resource (non-namespaced) ===" >> "$OUTPUT_FILE"
kubectl get $resource >> "$OUTPUT_FILE" 2>/dev/null
done

echo "Diagnostics collected to $OUTPUT_FILE"

0 comments on commit 8dada31

Please sign in to comment.