You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

observability_management.md 3.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # User Guide for Observability Management
  2. This guide covers how to install Observability Management on an existing Sedna environment.
  3. If you don't have an existing Sedna or KubeEdge environment, you can follow the [Sedna Installation Document](https://github.com/kubeedge/sedna/blob/main/docs/setup/install.md) to install what you need.
  4. ## Get Helm Repos Info
  5. This project is based on Grafana and Prometheus community, so you need to get helm repos firstly.
  6. ```
  7. helm repo add grafana https://grafana.github.io/helm-charts
  8. helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
  9. helm repo update
  10. ```
  11. ## Configs
  12. ### Node Selector
  13. You should label one node, so that you can deploy components like Grafana, Prometheus and Loki on this node.
  14. Cloud node is recommended to be chosen for deploying the components needed on Observability Management.
  15. ```
  16. # If sedna-mini-control-plane is the node you chose for deployment.
  17. kubectl label nodes sedna-mini-control-plane labelName=master
  18. ```
  19. ## Installation
  20. ### Kube-state-metrics
  21. ```
  22. cd sedna/components/dashboard/kube-state-metrics
  23. helm install kube-state-metrics prometheus-community/kube-state-metrics -f values.yaml
  24. ```
  25. After Installation, you can curl the url kube-state-metrics exposed to check whether the metrics can be collected.
  26. If pod IP of Kube-state-metrics is 10.244.0.127, the url is 10.244.0.127:8080/metrics
  27. ### Exporter (Optional)
  28. Currently, the exporter is only used for collecting inference counts and numbers of hard samples.
  29. These metrics are not shown in the running yamls, so kube-state-metrics can not collect these custom metrics.
  30. ```
  31. cd sedna/components/dashboard/exporter/incremental_learning/hardSamplesExporter.py
  32. cd sedna/components/dashboard/exporter/joint_inference/hardSamplesExporter.py
  33. ```
  34. 1. Edit the exporter if needed. (The current paths are for demo test cases.)
  35. 2. Run the exporter on the node which is producing hard samples.
  36. ### Prometheus
  37. ```
  38. cd sedna/components/dashboard/prometheus
  39. ```
  40. If you run the exporters before, you need to edit **values.yaml** of Prometheus.
  41. ```yaml
  42. serverFiles:
  43. prometheus.yml:
  44. scrape_configs:
  45. ...
  46. - job_name: "sedna-exporter"
  47. static_configs:
  48. - targets:
  49. - ${The node IP you run the exporter}:${Port(Default as 8000)}
  50. ```
  51. Install Prometheus
  52. ```
  53. helm install prometheus prometheus-community/prometheus -f values.yaml
  54. ```
  55. If the installation is successful, you can see UI of Prometheus on http://{The node you labeled for deployment}:30003
  56. At **Targets** view of Prometheus UI, the states of kube-state-metrics and sedna_exporter(Optional) are **UP**.
  57. ![](../images/kube-state-metrics_up.png)
  58. ![](../images/sedna_exporter_up.png)
  59. ### Loki
  60. ```
  61. cd sedna/components/dashboardloki-stack
  62. helm install loki grafana/loki-stack -f values.yaml
  63. ```
  64. Because there are no kubelets on edge nodes, some problems like this [issue](https://github.com/kubeedge/kubeedge/issues/4170) make promtail on edge node can not collect logs.
  65. ### Grafana
  66. There are several dashboard files in `sedna/components/dashboard/grafana/dashboards`.
  67. To automatically load these files, you need to download files of [Grafana-Chart](https://github.com/grafana/helm-charts/tree/main/charts/grafana) to directory `sedna/components/dashboard/grafana` firstly.
  68. Then replace the original directory `dashboards` and original values.yaml with ours.
  69. ```
  70. cd sedna/components/dashboard/grafana
  71. helm install grafana . -f values.yaml
  72. ```
  73. After installation, you can see UI of Grafana on http://{The node you labeled for deployment}:31000
  74. You can get your 'admin' user password by running:
  75. ```
  76. kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
  77. ```
  78. When you log in, you can see some dashboards designed for Sedna.
  79. ![](../images/dashboards.png)
  80. ![](../images/demo.png)