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

107 lines
4.2 KiB

  1. Kube-router
  2. ===========
  3. Kube-router is a L3 CNI provider, as such it will setup IPv4 routing between
  4. nodes to provide Pods' networks reachability.
  5. See [kube-router documentation](https://www.kube-router.io/).
  6. ## Verifying kube-router install
  7. Kube-router runs its pods as a `DaemonSet` in the `kube-system` namespace:
  8. * Check the status of kube-router pods
  9. ```
  10. # From the CLI
  11. kubectl get pod --namespace=kube-system -l k8s-app=kube-router -owide
  12. # output
  13. NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE
  14. kube-router-4f679 1/1 Running 0 2d 192.168.186.4 mykube-k8s-node-nf-2 <none>
  15. kube-router-5slf8 1/1 Running 0 2d 192.168.186.11 mykube-k8s-node-nf-3 <none>
  16. kube-router-lb6k2 1/1 Running 0 20h 192.168.186.14 mykube-k8s-node-nf-6 <none>
  17. kube-router-rzvrb 1/1 Running 0 20h 192.168.186.17 mykube-k8s-node-nf-4 <none>
  18. kube-router-v6n56 1/1 Running 0 2d 192.168.186.6 mykube-k8s-node-nf-1 <none>
  19. kube-router-wwhg8 1/1 Running 0 20h 192.168.186.16 mykube-k8s-node-nf-5 <none>
  20. kube-router-x2xs7 1/1 Running 0 2d 192.168.186.10 mykube-k8s-master-1 <none>
  21. ```
  22. * Peek at kube-router container logs:
  23. ```
  24. # From the CLI
  25. kubectl logs --namespace=kube-system -l k8s-app=kube-router | grep Peer.Up
  26. # output
  27. time="2018-09-17T16:47:14Z" level=info msg="Peer Up" Key=192.168.186.6 State=BGP_FSM_OPENCONFIRM Topic=Peer
  28. time="2018-09-17T16:47:16Z" level=info msg="Peer Up" Key=192.168.186.11 State=BGP_FSM_OPENCONFIRM Topic=Peer
  29. time="2018-09-17T16:47:46Z" level=info msg="Peer Up" Key=192.168.186.10 State=BGP_FSM_OPENCONFIRM Topic=Peer
  30. time="2018-09-18T19:12:24Z" level=info msg="Peer Up" Key=192.168.186.14 State=BGP_FSM_OPENCONFIRM Topic=Peer
  31. time="2018-09-18T19:12:28Z" level=info msg="Peer Up" Key=192.168.186.17 State=BGP_FSM_OPENCONFIRM Topic=Peer
  32. time="2018-09-18T19:12:38Z" level=info msg="Peer Up" Key=192.168.186.16 State=BGP_FSM_OPENCONFIRM Topic=Peer
  33. [...]
  34. ```
  35. ## Gathering kube-router state
  36. Kube-router Pods come bundled with a "Pod Toolbox" which provides very
  37. useful internal state views for:
  38. * IPVS: via `ipvsadm`
  39. * BGP peering and routing info: via `gobgp`
  40. You need to `kubectl exec -it ...` into a kube-router container to use these, see
  41. <https://www.kube-router.io/docs/pod-toolbox/> for details.
  42. ## Kube-router configuration
  43. You can change the default configuration by overriding `kube_router_...` variables
  44. (as found at `roles/network_plugin/kube-router/defaults/main.yml`),
  45. these are named to follow `kube-router` command-line options as per
  46. <https://www.kube-router.io/docs/user-guide/#try-kube-router-with-cluster-installers>.
  47. ## Caveats
  48. ### kubeadm_enabled: true
  49. If you want to set `kube-router` to replace `kube-proxy`
  50. (`--run-service-proxy=true`) while using `kubeadm_enabled`,
  51. then 'kube-proxy` DaemonSet will be removed *after* kubeadm finishes
  52. running, as it's not possible to skip kube-proxy install in kubeadm flags
  53. and/or config, see https://github.com/kubernetes/kubeadm/issues/776.
  54. Given above, if `--run-service-proxy=true` is needed it would be
  55. better to void `kubeadm_enabled` i.e. set:
  56. ```
  57. kubeadm_enabled: false
  58. kube_router_run_service_proxy: true
  59. ```
  60. If for some reason you do want/need to set `kubeadm_enabled`, removing
  61. it afterwards behave better if kube-proxy is set to ipvs mode, i.e. set:
  62. ```
  63. kubeadm_enabled: true
  64. kube_router_run_service_proxy: true
  65. kube_proxy_mode: ipvs
  66. ```
  67. ## Advanced BGP Capabilities
  68. https://github.com/cloudnativelabs/kube-router#advanced-bgp-capabilities
  69. If you have other networking devices or SDN systems that talk BGP, kube-router will fit in perfectly.
  70. From a simple full node-to-node mesh to per-node peering configurations, most routing needs can be attained.
  71. The configuration is Kubernetes native (annotations) just like the rest of kube-router.
  72. For more details please refer to the https://github.com/cloudnativelabs/kube-router/blob/master/docs/bgp.md.
  73. Next options will set up annotations for kube-router, using `kubectl annotate` command.
  74. ```
  75. kube_router_annotations_master: []
  76. kube_router_annotations_node: []
  77. kube_router_annotations_all: []
  78. ```