Preparing the environment for Calico as a Docker network plugin
The worked example in the Calico as a Docker network plugin tutorial is run on two Linux servers that have a number of installation requirements.
This tutorial describes how to manually configure a working environment for the example.
You will need 2 servers (bare metal or VMs) with a modern 64-bit Linux OS and IP connectivity between them.
We recommend configuring the hosts with the hostname
calico-02. The worked example will refer to these hostnames.
They must have the following software installed:
- Docker 1.9 or greater (details below)
calicoctlbinary in your path (see below)
You will also need an etcd cluster which Calico uses for coordinating state between the nodes. This may installed on one or both of the two servers for the worked example. See the etcd documentation for details on setting up a cluster.
NOTE: If you are running etcd with SSL/TLS, see the Etcd Secure Cluster documentation.
Docker (with multi-host networking)
Follow the instructions for installing Docker. A version of 1.9 or greater is required.
To use Calico as a Docker network plugin, the Docker daemon
needs to run specifying a cluster store. If using etcd as a cluster store,
cluster-store on the Docker daemon to
<ETCD IP> and
Running Docker is much easier if your user has permissions to run Docker
commands. If your distro didn’t set this permissions as part of the install,
you can usually enable this by adding your user to the
docker group and
restarting your terminal.
sudo usermod -aG docker <your_username>
If you prefer not to do this you can still run the demo but remember to run
Getting calicoctl Binary
Get the calicoctl binary onto each host.
wget https://github.com/projectcalico/calico-containers/releases/download/v0.23.1/calicoctl chmod +x calicoctl
This binary should be placed in your
$PATH so it can be run from any
Preload the Calico docker images (optional)
You can optionally preload the Calico Docker image to avoid the delay when you
calicoctl node the first time. Select the appropriate version of the
calico/node as required by the version of calicoctl:
docker pull calico/node:v0.23.1
Verify the hostnames. If they don’t match the recommended names above then you’ll need to adjust the tutorial instructions accordingly.
Check that the hosts have IP addresses assigned, and that your hosts can ping one another.
Check that you are running with a suitable version of Docker.
It should indicate a version of 1.9 or greater.
You should also verify each host can access etcd. The following will return the current etcd version if etcd is available.
curl -L http://127.0.0.1:2379/version
Continue with the worked example
With the environment set up, you can run through the remainder of the worked example in the Calico as a Docker network plugin tutorial.