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.

debug-gm.md 1.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. This document is intended to provide contributors with an introduction to develop [GM(GlobalManager)][framework] of the Sedna project.
  2. ### Debug GM
  3. 1\. config GM:
  4. The config file is the yaml format:
  5. ```yaml
  6. kubeConfig: ""
  7. namespace: ""
  8. websocket:
  9. port: 9000
  10. localController:
  11. server: http://localhost:9100
  12. ```
  13. 1. `kubeConfig`: kubernetes config file, default `""`
  14. 1. `namespace`: the namespace GM watches, `""` means that gm watches all namespaces, default `""`.
  15. 1. `websocket`: since the current limit of kubeedge(1.5), GM needs to build the websocket channel for communicating between GM and LCs.
  16. 1. `localController`:
  17. - `server`: to be injected into the worker to connect LC.
  18. Generate a config yaml:
  19. ```shell
  20. cat > gm.yaml <<EOF
  21. kubeConfig: "${KUBECONFIG:-$HOME/.kube/config}"
  22. namespace: ""
  23. websocket:
  24. port: 9000
  25. localController:
  26. server: http://localhost:9100
  27. EOF
  28. ```
  29. 2\. compile and run GM directly:
  30. If you have already run Sedna by following the [install doc],
  31. you need to stop GM by `kubectl -n sedna scale --replicas=0 gm` before,
  32. and reconfig `GM_ADDRESS` of LC by `kubectl -n sedna edit daemonset lc`.
  33. ```shell
  34. make WHAT=gm
  35. _output/bin/sedna-gm --config gm.yaml -v4
  36. ```
  37. Alternatively you can debug GM with [golang delve]:
  38. ```shell
  39. dlv debug cmd/sedna-gm/sedna-gm.go -- --config gm.yaml -v4
  40. ```
  41. [install doc]: /docs/setup/install.md
  42. [golang delve]: https://github.com/go-delve/delve
  43. [framework]: /docs/proposals/architecture.md#architecture