diff --git a/must-gather/.DS_Store b/must-gather/.DS_Store new file mode 100644 index 000000000..3468f1d98 Binary files /dev/null and b/must-gather/.DS_Store differ diff --git a/must-gather/Dockerfile b/must-gather/Dockerfile new file mode 100644 index 000000000..7bd5bad4d --- /dev/null +++ b/must-gather/Dockerfile @@ -0,0 +1,6 @@ +FROM quay.io/openshift/origin-cli:latest + +# copy all collection scripts to /usr/bin +COPY collection-scripts/* /usr/bin/ + +ENTRYPOINT /usr/bin/gather diff --git a/must-gather/Makefile b/must-gather/Makefile new file mode 100644 index 000000000..c43ffe165 --- /dev/null +++ b/must-gather/Makefile @@ -0,0 +1,10 @@ +GATHER_IMG ?= must-gather +IMAGE_BUILDER ?= docker + +build-must-gather: + ${IMAGE_BUILDER} build . -t ${GATHER_IMG} + +push-must-gather: + ${IMAGE_BUILDER} push ${GATHER_IMG} + +build-and-push-must-gather: build-must-gather push-must-gather diff --git a/must-gather/README.md b/must-gather/README.md new file mode 100644 index 000000000..8ce268ab3 --- /dev/null +++ b/must-gather/README.md @@ -0,0 +1,32 @@ +# must-gather for Open Data Hub + +The must-gather script allows a cluster admin to collect information about various key resources and namespaces +for Open Data Hub. + +## Data Collected + +The must-gather script currently collects data from all the namespaces that has - +- `KfDef` instances +- `Notebook` instances +- `Inferenceservice` instances + + +## Usage + +``` +oc adm must-gather --image=quay.io/opendatahub/must-gather:v1.0.0 +``` +## Developer Guide + +To build custom image : + +``` +export GATHER_IMG= +make build-and-push-must-gather + +``` + +To collect data for custom repositories for Open Data Hub set the following variables: + +``` +export ODH_NAMESPACE= \ No newline at end of file diff --git a/must-gather/collection-scripts/gather b/must-gather/collection-scripts/gather new file mode 100755 index 000000000..f12eb35dc --- /dev/null +++ b/must-gather/collection-scripts/gather @@ -0,0 +1,18 @@ +#!/bin/bash + +kfdefs=$(oc get kfdefs --all-namespaces -o=jsonpath='{range .items[*]}{.metadata.namespace}{"\n"}{end}') + +# Get logs from all KfDef namespaces +for i in $kfdefs; +do +# Get pod logs for all the pods in KfDef namespaces +oc adm inspect namespace/"$i" --dest-dir=must-gather || echo "Error getting logs from $i" + +done + +## Get Operator pod logs +mkdir must-gather/odh-operator || echo "Error creating odh-operator directory" +oc logs deployment/opendatahub-operator -n openshift-operators >> must-gather/odh-operator/pod.log + +exit 0 + diff --git a/must-gather/collection-scripts/gather-model-mesh b/must-gather/collection-scripts/gather-model-mesh new file mode 100755 index 000000000..85c2b5f47 --- /dev/null +++ b/must-gather/collection-scripts/gather-model-mesh @@ -0,0 +1,12 @@ +#!/bin/bash + +inferenceservices=$(oc get inferenceservice --all-namespaces -o=jsonpath='{range .items[*]}{.metadata.namespace}{"\n"}{end}') + +# Get logs from all Inferenceservices namespaces +for i in $inferenceservices; +do +# Get pod logs for all the pods in Inferenceservices namespaces +oc adm inspect namespace/"$i" --dest-dir=must-gather || echo "Error getting logs from $i" + +done + diff --git a/must-gather/collection-scripts/gather-notebooks b/must-gather/collection-scripts/gather-notebooks new file mode 100755 index 000000000..69ff90a32 --- /dev/null +++ b/must-gather/collection-scripts/gather-notebooks @@ -0,0 +1,13 @@ +#!/bin/bash + +notebooks=$(oc get notebook --all-namespaces -o=jsonpath='{range .items[*]}{.metadata.namespace}{"\n"}{end}') + +# Get logs from all notebook namespaces +for i in $notebooks; +do +# Get pod logs for all the pods in Notebook namespaces +mkdir must-gather/notebooks || echo "Error creating odh-operator directory" +oc adm inspect namespace/"$i" --dest-dir=must-gather/notebooks || echo "Error getting logs from $i" + +done +