Sign inSign up

travix/haproxy

By travix

•Updated over 9 years ago

Haproxy container for tls termination inside a Kubernetes pod

Image
0

500K+

travix/haproxy repository overview

⁠travix/haproxy

HAProxy⁠ load balancer

Stars Pulls License

⁠Usage

To run this docker container use the following command

docker run -d travix/haproxy:latest

⁠Environment variables

In order to configure the haproxy load balancer for providing ssl on port 443 for your gocd server you can use the following environment variables

NameDescriptionDefault value
BASIC_AUTHSpace separated list of users for BasicAuth
OFFLOAD_TO_PORTThe http port the actual application inside the Kubernetes pod listens to5000
SSL_CERTIFICATE_NAMEThe pem filename for the ssl certificate used on port 443ssl.pem
X_FORWARDED_FOR_HEADERX-Forwarded-For header value to checkX-Forwarded-For
X_FRAME_OPTIONSX-Frame-Options header valueDENY

⁠Custom port

docker run -d -e "OFFLOAD_TO_PORT=8153" travix/haproxy:latest

⁠IP Whitelisting

docker run -d \
    -e "WHITELIST_CIDRS=1.2.3.4/32 192.168.0.1/24" \
    travix/haproxy:latest

⁠Basic authentication

docker run -d \
    -e "BASIC_AUTH=user1:pass1234 user2:1234pass" \
    travix/haproxy:latest

⁠Mounting volumes

In order to keep your ssl certificate outside of the container on the host machine you can mount the following directory

DirectoryDescriptionImportance
/etc/ssl/private/SSL certificatesStore the files in a Kubernetes secret

Start the container like this to mount the directories

docker run -d \
    -e "OFFLOAD_TO_PORT=8153" \
    -e "SSL_CERTIFICATE_NAME=yourdomain.com.pem" \
    -v /mnt/persistent-disk/gocd-haproxy/ssl-private:/etc/ssl/private
    travix/gocd-haproxy:latest

Tag summary

Content type

Image

Digest

Size

63.5 MB

Last updated

over 10 years ago

docker pull travix/haproxy