smebberson / docker-alpine

Docker containers running Alpine Linux and s6 for process management. Solid, reliable containers.
MIT License
596 stars 186 forks source link

Consul: replace custom HTTP script check with built-in http/tcp check #40

Closed matthewvalimaki closed 7 years ago

matthewvalimaki commented 8 years ago

With updated Consul we can now use built-in http and tcp checks, see https://www.consul.io/docs/agent/checks.html. While certainly using custom "pings" is not wrong it is customization that should and could be avoided.

Example of HTTP check:

{
  "check": {
    "id": "api",
    "name": "HTTP API on port 5000",
    "http": "http://localhost:5000/health",
    "interval": "10s"
  }
}

Below are images with HTTP check. Perhaps we could just do http://localhost/ as that typically out of the box works?

smebberson commented 8 years ago

@matthewvalimaki, great suggestion. I was upgrading alpine-consul-apache so I thought I'd put this in as I go.

That works fine, however, can you please review https://github.com/smebberson/docker-alpine/blob/alpine-consul-apache-upgrade/alpine-consul-apache/Dockerfile#L7. Note the additional requirement of having to mkdir -p /run/apache2. This wasn't a requirement previously, but without it Apache fails to load with:

[Tue Apr 12 21:45:26.244458 2016] [core:error] [pid 794] (2)No such file or directory: AH00099: could not create /run/apache2/httpd.pid
[Tue Apr 12 21:45:26.244493 2016] [core:error] [pid 794] AH00100: httpd: could not log pid to file /run/apache2/httpd.pid

I'm not sure how the requirement was introduced? Are you happy for that mkdir to be there?

smebberson commented 8 years ago

@matthewvalimaki, are you still keen on working with docker-alpine or have you moved on to something else? I would still very much like your participation.

I went to update alpine-consul-ui to turn it into more of an example of how to run the UI now that it is integrated into the consul binary more than anything. And I've actually run into problems. The nodes aren't leaving properly anymore, so I'm working on resolving that. It might seem quiet, but I've been busily working on it.

matthewvalimaki commented 8 years ago

@smebberson I'm still here but got busy with other things. Let me get up to speed.

The /run/apache2 problem is really strange indeed. Apache does not create it automatically and I'm not sure if that is the expectation. In comparison to Nginx the build and init scripts seem similar. Only difference between Apache for 3.2 and 3.3 is in that default run dir is removed, check these out: http://git.alpinelinux.org/cgit/aports/tree/main/apache2/APKBUILD?h=3.2-stable and http://git.alpinelinux.org/cgit/aports/tree/main/apache2/APKBUILD#n143. I tried edge version of Apache with same broken results.

Adding mkdir -p /run/apache2 is acceptable but it bugs me :) Probably should reach out to maintainers of this package and ask what is wrong.

smebberson commented 7 years ago

@matthewvalimaki, I'm closing this out. Everything looks to be fine with latest round of updates.