This document describes the installation of a single docker node. It can be use to create a docker cluster to be used by tsuru. At the end of this document, you will have a running and configured docker node.
This document assumes you already have a tsuru server installed and running, if you don’t, follow the :doc: installation with docker <docker>. The docker installation on tsuru server in this case is optional, if you install it in the end you’ll have two docker nodes.
Now that you have you setup ready, let’s see how to install docker:
$ wget -qO- https://get.docker.io/gpg | sudo apt-key add - $ echo 'deb http://get.docker.io/ubuntu docker main' | sudo tee /etc/apt/sources.list.d/docker.list $ sudo apt-get update $ sudo apt-get install lxc-docker
/etc/init/docker.conf to start docker on tcp://0.0.0.0:4243:
description "Docker daemon" start on filesystem and started lxc-net stop on runlevel [!2345] respawn script /usr/bin/docker -H tcp://0.0.0.0:4243 -d end script
Now start it:
$ sudo start docker
Tsuru node agent¶
Now that you have docker installed and running it’s time to install tsuru node agent.
This agent is responsible to announce a docker node, unnannounce it, and run the
Add the tsuru/ppa then install it.
$ sudo add-apt-repository -y ppa:tsuru/ppa $ sudo apt-get update $ sudo apt-get tsuru-node-agent
$ start tsuru-node-agent docker-ssh-agent
Now it is need to announce the node we just created:
$ tsuru-node-agent node-add address=<address> ID=<server-id> team=<team-owner> -h <tsuru-api:port>
address parameter is the address of the node we just installed.
ID parameter is the identifier for this host that tsuru will use.
team parameter is the team that this host will attend, see the scheduler docs to know more about it. This
parameter is optional, if not passed, this node will be host of teams that doesn’t have a node associated for them.
-h flag is mandatory, and should be passed in the form http://tsuruhost.com, with http (or https),
otherwise it won’t be accepted as valid.
It’s highly important that every node is announced using the
node-add command. The configuration
tsuru.conf is deprecated and will be removed.