Coder Social home page Coder Social logo

million12 / docker-haproxy Goto Github PK

View Code? Open in Web Editor NEW
103.0 103.0 42.0 291 KB

Fully customisable HAProxy load balancer with HTTP/2 and ALPN support. Built on CentOS-7.

Home Page: https://registry.hub.docker.com/u/million12/haproxy/

Shell 51.50% Dockerfile 48.50%

docker-haproxy's Issues

HAProxy exits immediately - inotifywait prevents container exiting

For some reason haproxy exits immediately but the return code is 0. When I attach to the container and run "ps -ef" there is no haproxy process. The container eventually exits when the file changes and it can't find the PID file.

One other issue is that you allow the ports to be overridden using HAPROXY_PORTS but the Dockerfile exposes 80 and 443. I don't think it is possible to extend your container and un-expose those ports (see issue 3465) and expose different ports.

config : 'http-request' rules ignored for backend 'nodes-http2' as they require HTTP mode.

In the default configuration, there is

backend nodes-http2
    mode tcp
    http-request add-header X-Forwarded-Proto https
    server node1 web.server:81 check send-proxy

Using a similar conf I get [WARNING] 122/144630 (11) : config : 'http-request' rules ignored for backend 'nodes-http2' as they require HTTP mode.
So i was wondering if it should be working or if there's something in the config that somehow make this work

CI tests failed

The command "docker run --cap-add NET_ADMIN -ti million12/haproxy -vv" exited with 0.
0.77s$ docker run --cap-add NET_ADMIN -ti million12/haproxy -vv | grep "HA-Proxy version"
The command "docker run --cap-add NET_ADMIN -ti million12/haproxy -vv | grep "HA-Proxy version"" exited with 1.
0.77s$ docker run --cap-add NET_ADMIN -ti million12/haproxy -vv | grep "Encrypted password support"
The command "docker run --cap-add NET_ADMIN -ti million12/haproxy -vv | grep "Encrypted password support"" exited with 1.
0.76s$ docker run --cap-add NET_ADMIN -ti million12/haproxy -vv | grep "OpenSSL 1.0.2"
The command "docker run --cap-add NET_ADMIN -ti million12/haproxy -vv | grep "OpenSSL 1.0.2"" exited with 1.

Configuring logging

Big thanks for putting it all together! This has been very helpful in enabling our e2e gRPC-based channel.

The only issue that we found lacking in this example is the explicit support for configurable logging/tracing. This could be invaluable in troubleshooting edge cases like SSL termination or backend SSL. Has anyone solved this before and willing to share their experience? Are you using rsyslog or a some kind of sidecar container solution (e.g.: dockerfile/haproxy#3)?

inotifywait does not account all files that haproxy read

ie. errorfiles or certificates that are being specified in haproxy.cfg.
those are being read only once - on haproxy start.

two possible solutions for this:

  1. monitor /etc/haproxy (or whichever dir where haproxy.cfg resides) - this assumes that most people place entire haproxy configuration under etc, ie. inotifywait -r -q -e create,delete,modify,attrib $(dirname $HAPROXY_CONFIG) /etc/hosts
  2. parse haproxy.cfg and add files and directories (crt directive might specify directory to watch) - unfortunately haproxy's own src/cfgparse.c doesn't have an abstract function for reading files, so this would require to reparse in bash.

Docker Container Still Running While Haproxy Got OOM and Exited Out

When Haproxy received out of memory error and exited out, the docker container is still running without quitting or restarting.
It was probably caused by inotifywait in WHILE loop in bootstrap.sh. It does not try to detect if Haproxy is up or not.

The expected behavior should be that when Haproxy errors out and exited out inside Docker container, the docker container should either exit out so that the docker container could be relaunched by systemd service, or restart Haproxy inside the container.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.