I’ve adjusted the way we’re going to be deploying sensu go, and have started writing some configuration to begin using the docker images. Given that setting this up with Docker is relatively simple, I’m at a loss for the behavior I’m seeing.
On my workstation if I pull the image and start the container the entrypoint takes over correctly and I’m able to log in with the default admin credentials. Curling the health check returns good information and the backend responds readily to configuration.
Starting up a vagrant image based on Ubuntu 18.04 the container will start and it seems the processes are running correctly, but health checks do not return and some portion of the init is not working, as once the container starts and I’m able to access the web UI it will not accept the admin credentials specified in the entrypoint.
Docker Desktop on Mac OSX
REMC02XX71UJG5J:~ mcnultt$ docker exec -ti a55a1ed35dfc ps faux
PID USER TIME COMMAND
1 root 0:00 {sensu-backend} /usr/bin/dumb-init sh /usr/local/bin/sensu
6 root 0:00 sh /usr/local/bin/sensu-backend start --state-dir /var/lib
9 root 0:01 /opt/sensu/bin/sensu-backend start --state-dir /var/lib/se
45 root 0:00 ps faux
Docker Engine - Community 19.03.6 on Ubuntu 18.04
root@default-ubuntu-1804:~# docker exec -ti 38aaf30597bb ps
PID USER TIME COMMAND
1 root 0:00 {sensu-backend} /usr/bin/dumb-init sh /usr/local/bin/sensu
6 root 0:00 sh /usr/local/bin/sensu-backend start --state-dir /var/lib
9 root 0:01 /opt/sensu/bin/sensu-backend start --state-dir /var/lib/se
27 root 0:00 ps
Curling the health endpoint on this machine returns a variety of errors, sometimes it does not return at all and times out.
root@default-ubuntu-1804:~# curl -X GET http://127.0.0.1:8080/health
curl: (52) Empty reply from server
root@default-ubuntu-1804:~# curl -X GET http://127.0.0.1:8080/healthd
{"code":2,"message":"not found"}
root@default-ubuntu-1804:~# curl -X GET http://127.0.0.1:8080/health
curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection refused
The Ubuntu based image you are spinning up, are you installing and starting the Sensu backend directly?
As of version 5.16.0, the Sensu backend is not initialized by default see (release notes). If you install and start up a sensu-backend process, you need to initialize it.
This is done automatically in the Sensu provided docker images.
I’m sorry, I should’ve specified I’m using your provided images. Sensu/sensu:latest. The ubuntu box is simply the platform on which docker is controlling the containers.
I did leave this out, but I assume it to be the same as well.
vagrant@ubuntu-bionic:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9b8c9d472df0 sensu/sensu:5.17.2 "sensu-backend start" 7 minutes ago Up 7 minutes 0.0.0.0:3000->3000/tcp, 2379-2380/tcp, 8081/tcp, 0.0.0.0:8080->8080/tcp sensu-backend
root@default-ubuntu-1804:~# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
93f78ccc96a0 sensu/sensu:latest "sensu-backend start" 5 minutes ago Up 5 minutes 0.0.0.0:3000->3000/tcp, 2379-2380/tcp, 0.0.0.0:8080-8081->8080-8081/tcp sensu-backend