The CoreOS documentation for Network Plugins will walk you through the basics of setting up networking in rkt.
- A working etcd cluster.
- The calicoctl binary.
- Though Calico is capable of networking rkt containers, our core software is distributed and deployed in a docker container. While we work on native rkt support, you will need to run Calico in Docker before starting your rkt containers. This can be easily done wtih
calicoctl
by running the following command:sudo calicoctl node --ip=<IP> --rkt
rkt
looks for CNI plugins in/usr/bin/rkt/plugins/net
. Running the following command will start thecalico/node
container and automatically install the Calico CNI plugin, as well as the Calico CNI IPAM plugin to that directory.
sudo calicoctl node --rkt
You can configure multiple networks using the CNI. When using rkt
, each network is represented by a configuration file in /etc/rkt/net.d/
. Connections to a given container are only allowed from containers on the same network. Containers on multiple networks can be accessed by containers on each network that it is connected to.
- To define a CNI network for Calico, create a configuration file in
/etc/rkt/net.d/
.- Each network should be given a unique
"name"
- To use Calico networking, specify
"type": "calico"
- To use Calico IPAM, specify
"type": "calico-ipam"
in the"ipam"
section.
- Each network should be given a unique
For example:
~/$ cat /etc/rkt/net.d/10-calico.conf
{
"name": "example_net",
"type": "calico",
"ipam": {
"type": "calico-ipam"
}
}
Now that you have installed the Calico CNI plugin and configured a network, just include the --net=<network_name>
option when starting containers with rkt
. The containers will automatically be networked using Project Calico networking.
rkt run --net=example_net docker://busybox