Installing Calico for the Docker Containerizer

This document provides the commands to download and run Calico for use with the Docker Containerizer in Mesos.

Prerequisite: Docker

Calico networks Docker tasks for Mesos with its libnetwork plugin. In order to run the libnetwork plugin, the Docker daemon on each agent must be configured with a cluster store.

If using etcd as a cluster store, for example, run the Docker daemon with the following additional parameter:

    --cluster-store=etcd://<ETCD HOST>:<PORT>

Replacing <ETCD HOST>:<PORT> with the appropriate hostname:port for your etcd cluster.

Install and Run Calico

It is very easy to install Calico to use with the Docker Containerizer.

  1. On each Mesos Agents, download the calicoctl command-line tool:
curl -o /usr/bin/calicoctl -L
chmod a+x calicoctl
  1. Launch the calico/node and calico/node-libnetwork containers.

For production deployments, we recommend running the two containers as services. Visit our guide on running Calico as a Service to learn how to do this.

For test environments that you would like to get up and running quickly, you can launch the container with calicoctl:

sudo ETCD_AUTHORITY=<ETCD HOST:PORT> ./calicoctl node --libnetwork

Again, be sure to set the ETCD_AUTHORITY to the correct IP/Hostname:Port for your etcd cluster.

  1. Ensure calico’s services are running by checking for two Calico containers in Docker:
$ docker ps
CONTAINER ID        NAMES               IMAGE                           CREATED
19263eda1810        calico-libnetwork   calico/node-libnetwork:v0.9.0   3 seconds
f237fb21d357        calico-node         calico/node:v0.22.0             3 seconds
  1. Enable Docker Containerizer in Mesos.

By default, Mesos enables on the “Mesos” Containerizer. Be sure to also enable the Docker Containerizer:

sh -c 'echo docker > /etc/mesos-slave/containerizers'
systemctl restart mesos-slave.service

Next Steps

With Calico Installed, you’re now ready to launch Calico-networked tasks. See the Docker Containerizer Usage Guide for information.