Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce support bundle script for rebalancer #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions emp/baremetal/rebalancer-support-bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -e

if [[ "x${KUBECONFIG}" == "x" ]]; then
echo "KUBECONFIG variable not exported. Exiting."
exit 1
fi

date=$(date +%s)
tmpdir="/tmp/${date}"

echo "creating $tmpdir for support bundle"

mkdir -p $tmpdir


kubectl get clustersnapshots --all-namespaces -o json > $tmpdir/clustersnapshots.json
kubectl get rebalancerjobs --all-namespaces -o json > $tmpdir/rebalancerjobs.json
kubectl get migrationplans --all-namespaces -o json > $tmpdir/migrationplans.json
kubectl get evmmigration --all-namespaces -o json > $tmpdir/evmmigrations.json
kubectl get virtualmachineinstancemigration --all-namespaces -o json > $tmpdir/vmim.json
kubectl get namespaces > $tmpdir/namespaces.txt
kubectl get nodes -o json > $tmpdir/nodes.json || true
kubectl get pods --all-namespaces -o json > $tmpdir/pods.json || true
org_ns=$(kubectl get namespaces --no-headers | grep 'org-' | awk '{print $1}' | xargs)

echo "Found organization namespace: $org_ns"

kubectl logs --namespace kube-system deploy/pf9-evm-stack > $tmpdir/pf9-evm-stack.log

tar cvzf /tmp/rebalancer-$date.tgz $tmpdir > /dev/null 2>&1

rm -rf $tmpdir

echo "Wrote support bundle at: /tmp/rebalancer-$date.tgz"