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.

187 lines
5.2 KiB

  1. Calico
  2. ===========
  3. ---
  4. **N.B. Version 2.6.5 upgrade to 3.1.1 is upgrading etcd store to etcdv3**
  5. If you create automated backups of etcdv2 please switch for creating etcdv3 backups, as kubernetes and calico now uses etcdv3
  6. After migration you can check `/tmp/calico_upgrade/` directory for converted items to etcdv3.
  7. **PLEASE TEST upgrade before upgrading production cluster.**
  8. ---
  9. Check if the calico-node container is running
  10. ```
  11. docker ps | grep calico
  12. ```
  13. The **calicoctl** command allows to check the status of the network workloads.
  14. * Check the status of Calico nodes
  15. ```
  16. calicoctl node status
  17. ```
  18. or for versions prior *v1.0.0*:
  19. ```
  20. calicoctl status
  21. ```
  22. * Show the configured network subnet for containers
  23. ```
  24. calicoctl get ippool -o wide
  25. ```
  26. or for versions prior *v1.0.0*:
  27. ```
  28. calicoctl pool show
  29. ```
  30. * Show the workloads (ip addresses of containers and their located)
  31. ```
  32. calicoctl get workloadEndpoint -o wide
  33. ```
  34. and
  35. ```
  36. calicoctl get hostEndpoint -o wide
  37. ```
  38. or for versions prior *v1.0.0*:
  39. ```
  40. calicoctl endpoint show --detail
  41. ```
  42. ##### Optional : Define network backend
  43. In some cases you may want to define Calico network backend. Allowed values are 'bird', 'gobgp' or 'none'. Bird is a default value.
  44. To re-define you need to edit the inventory and add a group variable `calico_network_backend`
  45. ```
  46. calico_network_backend: none
  47. ```
  48. ##### Optional : BGP Peering with border routers
  49. In some cases you may want to route the pods subnet and so NAT is not needed on the nodes.
  50. For instance if you have a cluster spread on different locations and you want your pods to talk each other no matter where they are located.
  51. The following variables need to be set:
  52. `peer_with_router` to enable the peering with the datacenter's border router (default value: false).
  53. you'll need to edit the inventory and add a and a hostvar `local_as` by node.
  54. ```
  55. node1 ansible_ssh_host=95.54.0.12 local_as=xxxxxx
  56. ```
  57. ##### Optional : Define global AS number
  58. Optional parameter `global_as_num` defines Calico global AS number (`/calico/bgp/v1/global/as_num` etcd key).
  59. It defaults to "64512".
  60. ##### Optional : BGP Peering with route reflectors
  61. At large scale you may want to disable full node-to-node mesh in order to
  62. optimize your BGP topology and improve `calico-node` containers' start times.
  63. To do so you can deploy BGP route reflectors and peer `calico-node` with them as
  64. recommended here:
  65. * https://hub.docker.com/r/calico/routereflector/
  66. * https://docs.projectcalico.org/v3.1/reference/private-cloud/l3-interconnect-fabric
  67. You need to edit your inventory and add:
  68. * `calico-rr` group with nodes in it. At the moment it's incompatible with
  69. `kube-node` due to BGP port conflict with `calico-node` container. So you
  70. should not have nodes in both `calico-rr` and `kube-node` groups.
  71. * `cluster_id` by route reflector node/group (see details
  72. [here](https://hub.docker.com/r/calico/routereflector/))
  73. Here's an example of Kubespray inventory with route reflectors:
  74. ```
  75. [all]
  76. rr0 ansible_ssh_host=10.210.1.10 ip=10.210.1.10
  77. rr1 ansible_ssh_host=10.210.1.11 ip=10.210.1.11
  78. node2 ansible_ssh_host=10.210.1.12 ip=10.210.1.12
  79. node3 ansible_ssh_host=10.210.1.13 ip=10.210.1.13
  80. node4 ansible_ssh_host=10.210.1.14 ip=10.210.1.14
  81. node5 ansible_ssh_host=10.210.1.15 ip=10.210.1.15
  82. [kube-master]
  83. node2
  84. node3
  85. [etcd]
  86. node2
  87. node3
  88. node4
  89. [kube-node]
  90. node2
  91. node3
  92. node4
  93. node5
  94. [k8s-cluster:children]
  95. kube-node
  96. kube-master
  97. [calico-rr]
  98. rr0
  99. rr1
  100. [rack0]
  101. rr0
  102. rr1
  103. node2
  104. node3
  105. node4
  106. node5
  107. [rack0:vars]
  108. cluster_id="1.0.0.1"
  109. ```
  110. The inventory above will deploy the following topology assuming that calico's
  111. `global_as_num` is set to `65400`:
  112. ![Image](figures/kubespray-calico-rr.png?raw=true)
  113. ##### Optional : Define default endpoint to host action
  114. By default Calico blocks traffic from endpoints to the host itself by using an iptables DROP action. When using it in kubernetes the action has to be changed to RETURN (default in kubespray) or ACCEPT (see https://github.com/projectcalico/felix/issues/660 and https://github.com/projectcalico/calicoctl/issues/1389). Otherwise all network packets from pods (with hostNetwork=False) to services endpoints (with hostNetwork=True) withing the same node are dropped.
  115. To re-define default action please set the following variable in your inventory:
  116. ```
  117. calico_endpoint_to_host_action: "ACCEPT"
  118. ```
  119. Cloud providers configuration
  120. =============================
  121. Please refer to the official documentation, for example [GCE configuration](http://docs.projectcalico.org/v1.5/getting-started/docker/installation/gce) requires a security rule for calico ip-ip tunnels. Note, calico is always configured with ``ipip: true`` if the cloud provider was defined.
  122. ##### Optional : Ignore kernel's RPF check setting
  123. By default the felix agent(calico-node) will abort if the Kernel RPF setting is not 'strict'. If you want Calico to ignore the Kernel setting:
  124. ```
  125. calico_node_ignorelooserpf: true
  126. ```
  127. Note that in OpenStack you must allow `ipip` traffic in your security groups,
  128. otherwise you will experience timeouts.
  129. To do this you must add a rule which allows it, for example:
  130. ```
  131. neutron security-group-rule-create --protocol 4 --direction egress k8s-a0tp4t
  132. neutron security-group-rule-create --protocol 4 --direction igress k8s-a0tp4t
  133. ```