How to collect Longhorn bundle separately?
In scenarios where the issue is related to Longhorn and for some reason, the docker pod or any relevant failure disallows customers to collect the Support bundle, the below script can help collect the Longhorn bundle.
Steps:
-
Create a file with any custom name i.e.: vim longhorn_bundle.sh
-
Paste the below content in the file:
BACKEND_URL=$(kubectl -n longhorn-system get svc longhorn-backend -o jsonpath="{.spec.clusterIP}"):9500ISSUE_URL="Issues · longhorn/longhorn · GitHub;
ISSUE_DESCRIPTION="dummy description"Request to create the support bundle
REQUEST_SUPPORT_BUNDLE=$( curl -sSX POST -H 'Content-Type: application/json' -d '{ "issueURL": "'"${ISSUE_URL}"'", "description": "'"${ISSUE_DESCRIPTION}"'" }' http://${BACKEND_URL}/v1/supportbundles )
ID=$( jq -r '.id' <<< ${REQUEST_SUPPORT_BUNDLE} )
SUPPORT_BUNDLE_NAME=$( jq -r '.name' <<< ${REQUEST_SUPPORT_BUNDLE} )
echo "Creating support bundle ${SUPPORT_BUNDLE_NAME} on Node ${ID}"while [ $(curl -sSX GET http://${BACKEND_URL}/v1/supportbundles/${ID}/${SUPPORT_BUNDLE_NAME} | jq -r '.state' ) != "ReadyForDownload" ]; do
echo "Progress: $(curl -sSX GET http://${BACKEND_URL}/v1/supportbundles/${ID}/${SUPPORT_BUNDLE_NAME} | jq -r '.progressPercentage' )%"
sleep 1s
done
curl -X GET http://${BACKEND_URL}/v1/supportbundles/${ID}/${SUPPORT_BUNDLE_NAME}/download --output /tmp/${SUPPORT_BUNDLE_NAME}.zip
echo "Downloaded support bundle to /tmp/${SUPPORT_BUNDLE_NAME}.zip"
-
Allow permission to execute:
-
chmod +x longhorn_bundle.sh
-
-
Execute the file:
-
./longhorn_bundle.sh
-
This will generate a bundle in the /tmp/ directory.
In case the customer uses Proxies, feel free to retrieve the service IP using the below command:
-
kubectl get svc -n longhorn-system longhorn-backend
Add the Service_IP in the line and prepend the same in Step2 and collect the BundleL.
export no_proxy="Service_IP"