Make drone agent listen some port

Hello! I’ve been using autoscaler with GCP for ages, but we need to have low memory agent for some automation tasks.

Previously we could launch an agent with some metrics port to check if it’s alive, but now I can’t find anything for 1.0 in reference. We’re using nomad, no way to make it think that agent is healthy without port.

Any ideas?

Thanks a lot in advance!

If the agents dies, the container exits with a non-zero exit code. The healthcheck in 0.8 therefore provided no actual benefit.

kk, thanks for info. gonna research workaround for nomad then

Hello yellowmegaman

This is off topic but do you mind sharing how you are using autoscaler with GCP? it is not obvious to me how drone gets the required permission to spin up new instances to host the agents.

@madsonic hi! Actually it’s greatly covered here https://autoscale.drone.io/intro/google

The only addition to that - I use scopes compute:rw for instance with drone server, so it can ask GCP to launch instances without auth.

https://www.terraform.io/docs/providers/google/r/compute_instance.html#scopes

I have read through that but it seems little strange that authentication is not covered. Does it not require a service account .json key file or something similar to be able to interact with gcloud? I am probably missing something

Yep) It’s scopes) When you launch instance in GCP, you can define scopes for vm. If you launch vm with scopes
compute-rw and storage-ro, autoscaler can spawn machines without json auth, because machine it is running on itself has rights to launch instances on GCE.

1 Like