I think this is a deficiency in the script logic in the official docker images preventing the etcd service discovery options from working. It appears that existing logic always sets SENSU_BACKEND_ETCD_INITIAL_CLUSTER envvar.
I think the mitigation for now is going to be custom docker image with updated script logic to fix the problem. I’d offer you an alternative script to try, but I’m not confident I’d get the changes correct. You probably know what you need to get the etcd discovery to work more than i do. So it might be best if you construct your own custom docker image and report back with the needed changes for us to integrate and test.
Here’s the procedure I’ve been following to extract the script from the official image and then generate a local custom image when i need to test a behavior change.
- pull the sensu/sensu:latest docker image
docker pull sensu/sensu:latest
- create a container from the image
docker create --name sensu_extract sensu/sensu:latest
- extract the file
/opt/sensu/bin/entrypoint.sh
(from the container)
docker cp sensu_extract:/opt/sensu/bin/entrypoint.sh entrypoint.sh
- remove the container
docker rm sensu_extract
- edit the extracted file
- construct new Dockerfile that uses sensu/sensu:latest with an additional COPY operation to place the editted file back into the container image
FROM sensu/sensu:latest
COPY entrypoint.sh /opt/sensu/bin/entrypoint.sh
- edit the extract entrypoint.sh file to update the logic.
- build a custom image containing the editted script using the local Dockerfile.
docker build -t sensu-local -f Dockerfile ./
- repeat 7 and 8 until new logic works.
We’re working on making the official Dockerfiles public in a repository to make it easier for people to collaborate around exactly these sorts of things and propose changes. If we don’t have that public repository in place by the time you sort this out, I can take proposed script edits from you and shepard them into the existing private repo pull request process on your behalf.
I hope this helps.