-
Notifications
You must be signed in to change notification settings - Fork 28
Kubernetes Support Bundle Kit Design Target (Phase 1)
Sheng Yang edited this page Jul 2, 2021
·
2 revisions
- It's not easy to debug a Kubernetes native application. If you have collected the YAML files and logs for the pod, since it's natural of microservice, you have to look into different YAML and logs to find the needed information. It's hard to navigate through the YAML files if you only treat them as text files.
- Many Kubernetes native projects (like Longhorn and Harvester) already have a built-in support bundle generation mechanism, which can help with troubleshooting. But many code are duplicated across different projects.
- In addition to debug Kubernetes native applications, there is a need to help to debug Kubernetes itself, along with system-level logs. The Rancher support team has a script to collect Rancher/RKE/K3S related logs, but it's separated from the applications running on Kubernetes.
- Create a unified support bundle generator for Kubernetes and Kubernetes native applications.
- The generator will collect the YAMLs and logs from user-specified namespaces, as well as logs from system-level service on the nodes from all the Kubernetes nodes.
- The generator can be run in two modes:
- As one-time progress directly from a URL with the configuration
- As a server to can communicate with a Kubernetes native application to
- Initiate the collecting
- Report collecting progress
- Provide a way to download the support bundle (most likely from the application UI).
- The format of the support bundle will be a ZIP file.
- Integration goal
- The generator should replace the current support bundle collection mechanism in Longhorn, Harvester. It should also replace the Rancher support bundle collecting script above.
- Create a support bundle analyzer for the support bundle generated above.
- User should be able to import the support bundle directly into the analyzer.
- Analyzer should be able to generate a mocked Kubernetes environment using the information in the support bundle.
- User should be able to use
kubectl
ork9s
to navigate the environment, as it's in the environment where the support bundle was collected. - For non-Kubernetes log/information, the analyzer will provide a way for the user to easily navigate through them.
- Probably as a mocked Kubernetes resource inside the mocked Kubernetes environment.
- User should be able to use
- The generated support bundle should be useful and correct by itself.
- User should still able to inspect the support bundle as they wish when need. They don't have to import it into the analyzer.
- How to collect all the resources within a namespace
- Might need to get the list of available API resources in the cluster before trying to collect the YAML.
- The correctness of the object from imported YAML
- Imported YAMLs will result in a refresh
creationTimestamp
for the object.
- Imported YAMLs will result in a refresh
- How to hook up to the
kubectl log
command for the related logs.
Longhorn support bundle: https://github.com/longhorn/longhorn-manager/blob/27c93ca97bf6966c7a946ef223366f3ac6e70d62/manager/misc.go#L112
Harvester support bundle: this repo