Kraken Agent can be deployed in multiple ways. Here is presented a new way that leverages Docker Compose. It is not scalable as such agents are run on the same machine but it is quick and simple and if we need just to have one or two more agents this is a way to go.
To add such agents we will extend Docker Compose from QuickStart.
There is already defined one built-in agent. But first, several modifications are needed to solve IP addressing issues. The problem is that it may get a different IP address after a container restart than before. Kraken Server requires that the addresses do not change otherwise it is not possible to identify agents by the Kraken Server.
First, open your compose file (e.g. kraken-docker-compose-X.Y.yaml)
and enable IP Address Management (IPAM) in the
lab_net where all
# add the following lines at the end of compose file
- subnet: 172.20.0.0/16
Here is added a subnet with particular addresses class,
172.20.0.0/16. You can define any subnet definition you need.
And now add extra agents by copy-pasting
- New agent service name should be different e.g.
- KRAKEN_AGENT_BUILTIN=1environment variable that can be only in one agent.
- Add explicit IP address in
ipv4_address: 172.20.0.11. Every new agent needs to have a different IP address.
Before running such a modified compose file, shut down the currently
running compose and delete
lab_net. To delete this network, first,
check if it exists:
$ docker network ls
It should have name like this
<current-folder-name>_lab_net. Please delete it:
$ docker network rm <current-folder-name>_lab_net
Now you can start Docker Compose again.
lab_net network will be
recreated with proper new settings:
$ docker-compose --env-file kraken-X.Y.env -f kraken-docker-compose-X.Y.yaml up
Go to Discovered Agents page in Kraken Web UI and check if new agents are present there.
That's it. You have new agents running.