Skip to content

Commit

Permalink
add edge-pod-network doc
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjun93 committed May 18, 2021
1 parent a89289d commit 388001d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/tutorial/edge-pod-network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
In edge scenario, edge node can be offline since edge network is unstable,
thanks to node autonomy feature provided by yurt-hub, pods can still be working,
however there are some cases we need to take care.

### Flannel: keep Vtep mac address
If we use flannel as CNI plugin, in VXLAN mode, a Vtep device (usually named as "flannel.1") is created on each host,
and the VNI, VtepMAC info are recorded in kube node annotation, consumed by other nodes to be aware and apply
the corresponding routes and forwarding rules.
Each time node restarted, flannel will create Vtep device with new mac address, and update the info in node annotation.

However, if node is offline, the update cannot be truly done.
This will cause pod connectivity issues between edge nodes as other nodes are not aware of the mac address change.

**Solution: Keep Vtep mac address in flannel**

For each time flannel restarted and try to create new Vtep device, it reads the mac address from node annotation,
either from kube-apiserver or yurt-hub local cache, and use it for Vtep device if exists.

For this solution, there is minor code change in flannel.

### IPAM: keep pod ip address
In most cases, host-local IPAM is used for CNI plugin. It works by assigning free ip address for each new pod from node's CIDR range,
and recording the assigned ips in local path, to denote them occupied.
For some edge application, static pod ip is required, which means pod ip address cannot be changed when it's recreated.

**Solution: Keep ip address in IPAM**

To support this, we need to adjust the IPAM plugin to also record {ip}-{pod name} binding info, and pass pod name in request to IPAM.
For incoming ip allocation request, IPAM use the binded ip if pod name already exists in local path.

0 comments on commit 388001d

Please sign in to comment.