Day 13/100daysofK8s
WeaveWorks is one of the CNI networking plugins. Weave deploys it’s agent on every node and forms an internal network where every agent knows the location of every other agent and has the information about the entire setup.
Weave agents are connected to a common bridge and they assign IPs to each nodes.
A pod can have multiple routes setup, and what path a packet takes depends on the configured route. Weave ensures that the packet takes correct route to reach it’s destination.
Any time a packet needs to be sent from pod1 of node1 to pod2 of node2, wAgent1 of node1 will intercept the packet from pod1, encapsulates it with an added layer of information about the destination wAgent i.e. wAgent2 and send it to wAgent2 of node2, who in turn will decapsulate the information and forward it to pod2.
A weave agent can be deployed on a k8s cluster as a daemonset or a service on each node manually, or if the cluster is already set up, then it can also be deployed as a pod on the node with kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
.
Daemonset ensures that one pod of weave-net is deployed on all the nodes.