diff --git a/pkg/hhfab/show-tech/control.sh b/pkg/hhfab/show-tech/control.sh index 0bebf617..255bdfe0 100644 --- a/pkg/hhfab/show-tech/control.sh +++ b/pkg/hhfab/show-tech/control.sh @@ -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"