Installing the DO Agent on a Droplet created by Docker Cloud

January 17, 2018 1.7k views
Docker Monitoring

I have a few droplets created by docker cloud.
I like to install the DO Agent on the droplets, but I can’t find a way to ssh into the droplet. So I can install the agent

2 Answers

Droplets created by Docker Cloud are black boxes by default. You are unable to ssh in to them and mange the host directly. But you’re not out of luck! There is a (poorly documented) method of adding your ssh key to the Droplet utilizing the dockercloud/authorizedkeys Docker image. The image takes an ssh public key and makes it available to the host.

It is available as a predefined service on Docker Cloud:

Docker Cloud Services

The two key things to make sure are configured are the AUTHORIZED_KEYS environmental variable and a volume mounting /user in the container to /root on the host:

Configure in Docker Cloud

You’ll also likely want to configure the container to “autodestroy.” After the service runs, you should be able to ssh into the Droplet as you normally would to the root users.

Once you are able to access the Droplet via ssh, you can install the agent manually:

curl -sSL | sh

Check out this tutorial for all the details.

by Justin Ellingwood
DigitalOcean Monitoring tracks your server resource usage over time. Some metrics, like bandwidth and disk I/O, can be easily measured or calculated from external tools. For a more complete picture, the DigitalOcean Agent can be installed on Droplets to provide metrics for memory and disk utilization and pass along information about the top consumers of CPU and memory on the system. The Agent also allows you to set up .alert policies and notifications.

Maybe running the agent itself in a container could obviate the need to ssh into the droplets?!

Haven’t tested it though…

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!