-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using labels to configure haproxy running on a different host #34
Comments
I believe the easiest way to have your containers "discoverable" by the HAProxy is creating a Docker Swarm cluster and every container you want to access is deployed in this cluster. A docker swarm cluster won't change a lot how you are working with container. The only difference, you need to deploy "stacks". TL;DR:
Here an example using Docker Swarm: More info about HAProxy and Docker Swarm: By the end of the week, I am deploying a version that will allow you to deploy your containers in different networks. Currently, you need to make sure both HAProxy and your containers are in the same network. One important thing to mention it that on a Docker Swarm Cluster, you don't specify WHERE your container will be deployed. If that is the case, try this: https://stackoverflow.com/questions/63681999/how-to-deploy-container-to-subset-of-worker-nodes-in-a-docker-swarm-using-affini Let me know if that helps you. |
Hi, byjg. |
In that case, it is possible, but will require extra work. Let me know if in your environment you have:
|
Yeah I have all of that and of necessary I can setup any environment I
would need. Python 3.10 but if I have to downgrade to 3.9 then not a
problem.
…On Fri, 18 Nov 2022, 22:17 Joao M, ***@***.***> wrote:
In that case, it is possible, but will require extra work.
Let me know if in your environment you have:
- Python 3.9
- Nginx Daemon that you can control
- Docker Client (to connect to other Docker Containers)
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADHLLUOHUWVBTJ4XADXNNWLWI7553ANCNFSM6AAAAAASCLZ2FQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
OK, any python above 3.9 is fine. I never tested this steps below, but I am confident this is the most accurate. I'd appreciate your feedback, so I can include in the documentation too. Step 1: Clone the RepositoryStep 2: Install OS and Python RequirementsRequired OS packages:
cp -r build/assets /
cd src
pip install -r requirements.txt`
openssl dhparam -out /etc/haproxy/dhparam 2048
openssl dhparam -out /etc/haproxy/dhparam-1024 1024 Step 3: Adjust the code to handle HAProxy (start and reload)EasyHAProxy will start and reload the script by itself. In the container, this is already set up. However, running it in your own installation, you need to find the proper commands to start and reload the HAProxy here. Step 4: Set up the docker client to connect to the remote Host.EasyHAProxy get the configuration from the environment. So, if you have a remote docker host where EasyHAProxy should inspect you might need to set up your docker environment. e.g. export DOCKER_HOST="ssh://user@host" Step 5: Run EasyHAProxy
I hope this should be enough to run directly from your machine. |
Thank you for instructions, @byjg. I will try them as soon as possible but ATM things are moving slow as I'm changing jobs, redoing my proxmox server as a docker host and redoing my home network at the same time... |
Is it possible to run easy-haproxy in docker to read container labels, but then actually configure haproxy on a different host? I have haproxy running on my opnsense router and I have multiple servers at home. At the moment I'm using traefik but if I could have a single instance of haproxy on the router and it would automatically update when I bring containers up on various hosts, that would be the ideal setup.
If it's not possible, what would be the steps needed to implement something like that?
The text was updated successfully, but these errors were encountered: