Giter VIP home page Giter VIP logo

haproxy-docker-wrapper's Introduction

haproxy-docker-wrapper

This repository contains the code for an haproxy wrapper with these features:

  • Embedded syslog server to redirect haproxy logs to standard output
  • HTTP entry point to trigger haproxy configuration reloads

It also includes a Dockerfile to extend official haproxy dockers with this wrapper.

Usage

Start the wrapper passing as arguments the configuration needed for your environment, the defaults play well with the official haproxy docker image and the included Dockerfile uses this image as base.

Configuration directory is exposed as a volume. Sidecar container in charge of generating the configuration should use this volume. Both containers should also be in the same network namespace, so it can reach the control entry point without needing to expose it beyond a local interface.

To trigger a configuration reload, send an HTTP GET request to /reload in the control entry point (http://127.0.0.1:15000/reload by default).

Haproxy must be configured in daemon mode.

Why?

When trying to deploy haproxy in docker, you may face some recurrent problems:

  • haproxy only logs to syslog unless it's executed in debug mode, what is not recommended for production environments. In docker deployments it is usual to log everything to standard output and let logging drivers decide how to handle these logs.
  • Configuration reload in haproxy needs access to the pid namespace, to the pid file and to the configuration file. Providing all this from a sidecar container like kube2lb is quite complex. Not using sidecar and including the software managing the configuration in the same container makes any update in this software to require also a full restart of haproxy.

Credits & Contact

haproxy-docker-wrapper was created by Tuenti Technologies S.L.

You can follow Tuenti engineering team on Twitter @tuentieng.

License

haproxy-docker-wrapper is available under the Apache License, Version 2.0. See LICENSE file for more info.

haproxy-docker-wrapper's People

Contributors

jsoriano avatar mrodm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jsoriano mrodm negz

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.