Seagate / cortx-k8s

CORTX Kubernetes Orchestration Repository
https://github.com/Seagate/cortx
Apache License 2.0
6 stars 47 forks source link

CORTX-32645: New script: get-logs-from-pvc.sh #361

Closed walterlopatka closed 2 years ago

walterlopatka commented 2 years ago

Description

This is a new tool to collect log files from PVC for the case when a Pod is not running and support bundle cannot collect this data otherwise. This is intended to be a support or advanced tool for a special circumstance.

This uses a Kubernetes job to start a Pod that mounts the PVC specified by the user. It tars the contents of the PVC into tmp. The script then kubectl cp's the tar file to the local host.

This script provides basic error checking, but there are some inputs that can cause problems, such as specifying a PVC that does not exist in the specified namespace. In this case the script with hang with the collector pod in "Pending" state. (This is pretty obvious from script stdout.)

Type of change

Applicable issues

CORTX image version requirements

N/A

How was this tested?

Local testing of various cortx PVCs.

Checklist

If this change requires newer CORTX or third party image versions:

If this change addresses a CORTX Jira issue:

walterlopatka commented 2 years ago

I'm not sure of this needs any additional documentation. Maybe I should add something to the troubleshooting section of README. Hopefully this tack of using a job to tar the PVC contents, and then kubectl cp to the local host is good enough to satisfy the request.

osowski commented 2 years ago

lgtm

Well it looks good once the Shellcheck error is fixed.