Vela Top

In this guide, we want to introduce you how to use the vela top tool in KubeVela. This tool is a UI based CLI tool provided in KubeVela. By using it, you can obtain the overview information of the platform and diagnose the resource status of the application.

At present, the tool has provided the following feature:

  • Platform information overview
  • Display of resource status information at Application, Managed Resource, Pod and Container levels
  • Display Application Resource Topology
  • Display resource YAML text
  • Display log of pod and container

When launching the tool, we can specify the Namespace of the Application displayed in the Application view which is the home page.

  • Default Namespace

    1. vela top
  • Aimed Namespace

    1. vela top -n <namespace>
  • All Namespace

    1. vela top -A

After starting the tool, we will enter the home page: Application view, as shown below:

vela top home page

The tool is divided into three parts as a whole, as shown in the figure, they are the Header part containing basic information, platform system information, menu and logo, the Body part where the resource view is located, and the Footer part where the breadcrumb component of the resource level is located.

vela top platform overview

This information panel component will display the performance information of the KubeVela system, including the version of Vela Core and Vela CLI, the proportion of applications running in the KubeVela system to all applications, and the performance information of the Vela controller (Vela Core) and the Vela gateway (Vela Cluster GateWay). The current usage of CPU and memory accounts for the proportion of the two set values of request and limit respectively).

The performance information for the Vela Controller and Vela Gateway here actually comes from the performance information of the Pod where they are located. It should be noted that to collect the performance information of the Pod, you need to install the metrics server in the cluster, otherwise the performance information of the Pod will not be obtained correctly.

vela top app view

This view will display the status information of all Applications under the Namespace in the platform, including:

  • Name
  • Namespace
  • Phase
  • Workflow Mode
  • Number of successful Workflows / Number of Workflows
  • Number of Health Services / Number of Services
  • CreateTime

In this view, you can reselect the Application of which Namespace to display by pressing the N button:

vela top app namespace

You can also press the button ↑ or ↓ to select an application and then press the button T to display the resource topology of the application.

If you want to do resource penetration for this Application to see what resources belong to it, you can enter the next resource level by pressing the ENTER key.

vela top managed resource view

The Managed Resource view shows the next-level resources of the Application. The resource view shows the resources generated by the deployment of the target Application, including: Deployment, ConfigMap, Service, Helm Release, etc. We call these resources the resources managed by the application.

For Application-managed resources, we display the following information:

  • Name
  • Namespace
  • Kind
  • API Version
  • In which cluster
  • Belong to which component
  • Status

The resources managed by the application are very complex, so in this view, we provide some ways to filter the view. You can filter the resources according to the Namespace and the cluster where the resources are located. The corresponding keys are N and C, as shown below:

vela top managed resource filter

The title at the top of the view indicates that the Namespace and Cluster in which the resource is currently displayed.

In addition, in this view, you can also use the Q key to return to the previous Application view, and press the ENTER key after selecting a resource to enter the Pod view to display the Pod resources which belong to the resource.

vela top pod view

The deployment of Managed Resource results in the deployment of Pod resources, and the Pod view displays the Pod resources further generated by the target Managed Resource. For Pod resources, this view shows the following information about the Pod:

  • Name
  • Namespace
  • Cluster
  • Ready
  • Status
  • CPU usage
  • Memory usage
  • CPU usage as a percentage of request
  • CPU usage as a percentage of limit
  • Memory usage as a percentage of request
  • Memory usage as a percentage of limit
  • IP address
  • Node where it is located
  • Age

In this view you can still use the Q key to go back to the previous view.

vela top container view

Several containers are running in a pod, the Container View displays the containers’ info running in the selected pod. For Container resources, this view shows the following information about the Container:

  • Name
  • Image
  • Ready
  • State
  • CPU usage
  • Memory usage
  • CPU usage as a percentage of request
  • CPU usage as a percentage of limit
  • Memory usage as a percentage of request
  • Memory usage as a percentage of limit
  • Terminate Message
  • Restart Count

We have introduced the three views above, and now we will show you how to switch between multiple views to get the resource status information you want.

vela top resource switch

Maybe you want to know how the complete resource topology of an application is. We have provided such a function in VelaUX. In fact, we also provide you with a similar function in vela top. In the Application view, you can select an Application and press the T key, it will display the resource topology of the Application in two forms:

vela top topology

The application delivery model behind KubeVela is Open Application Model. Every application deployment plan can be composed by multiple components with attachable operational behaviors (traits), deployment policy and workflow. For the content of this part, please refer to KubeVela Core Concepts, so the first topology we show is to show the four components of the application, this topology is called the “App Topology”.

In addition, these components will actually eventually be loaded as native resources or CRDs in Kubernetes, and these resources constitute another resource topology. As a user, you must want to know whether the sub-resources of the application are correctly deployed as required, you can get the answer from this topology, which we call the “Resource Topology”.

vela top platform overview

In all kinds of resource views, you can select a resource and press the Y key to view the YAML text corresponding to the resource, and the text will be highlighted.

vela top log

In the Container view, you can use the L key to enter the log view, the log view will print the log of the selected container.

In the Container view, the method of entering the log view is the same as Pod view. What is different is the log are belong to the several containers in the selected pod.

vela top theme switch

In order to solve the problem that the display effect of the default color matching is different on different terminals, we provide the theme switching function. You can press Ctrl+T to switch themes. After the theme switching, you need to restart vela top to make the theme take effect.

At present, vela top has more than ten built-in themes, which you can choose according to your own preferences. However, to meet the needs of different users, we also provide the function of customizing themes. You can edit your theme file in the following format:

  1. # platform information component
  2. info:
  3. # title color
  4. title: "#69d9ed"
  5. # text color
  6. text: "#c3eff7"
  7. # menu component
  8. menu:
  9. # description text color
  10. description: "#6b7f7f"
  11. # key text color
  12. key: "#a7e24c"
  13. # Logo component
  14. logo:
  15. # logo text color
  16. text: "#f72972"
  17. # crumbs component
  18. crumbs:
  19. # text color
  20. foreground: "#e0e0e0"
  21. # background color
  22. background: "#5fd7ff"
  23. # table component
  24. table:
  25. # table title color
  26. title: "#ffffff"
  27. # table header color
  28. header: "#ffffff"
  29. # table body color
  30. body: "#5fd7ff"
  31. # resource status color
  32. status:
  33. starting: "#69d9ed"
  34. healthy: "#a7e24c"
  35. unhealthy: "#f72972"
  36. waiting: "#e47c20"
  37. succeeded: "#3174a2"
  38. failed: "#a7e24c"
  39. unknown: gray
  40. # YAML
  41. yaml:
  42. # YAML key color
  43. key: "#e47c20"
  44. # YAML colon color
  45. colon: "#e47c20"
  46. # YAML value color
  47. value: "#ffffff"
  48. # topology view
  49. topology:
  50. # topology tree line color
  51. line: "#69d9ed"
  52. # app node text color
  53. app: "#f72972"
  54. # workload node text color
  55. workflow: "#5fd7ff"
  56. # component node text color
  57. component: "#a7e24c"
  58. # policy node text color
  59. policy: "#e47c20"
  60. # trait node text color
  61. trait: "#f72972"
  62. # kind text color in resource topology
  63. kind: "#5fd7ff"

vela top custom theme

Place the edited theme configuration file in the ~/.vela/theme/themes folder, and then start vela top again to enter the theme switching interface. You can see that the theme you can select contains the newly edited custom theme.

In any interface, you can press the ? key to enter the help view, which will briefly introduce you to the related functions and usage of vela top.

Last updated on Feb 9, 2023 by dependabot[bot]