April 2018
Intermediate to advanced
468 pages
14h 34m
English
The loopback plugin simply adds the loopback interface. It is so simple that it doesn't require any network configuration information. Most CNI plugins are implemented in Golang, and the loopback CNI plugin is no exception. The full source code is available at:
https://github.com/containernetworking/plugins/blob/master/plugins/main/loopback
Let's look at the imports first. There are multiple packages from the container networking project on GitHub that provide many of the building blocks necessary to implement CNI plugins and the netlink package for adding and removing interfaces, as well as setting IP addresses and routes. We will look at the skel package soon:
package mainimport ( "github.com/containernetworking/cni/pkg/ns" ...
Read now
Unlock full access