Re: haproxy - namespece implementation and usage

2016-09-20 Thread Willy Tarreau
Hi Martin,

On Sat, Sep 17, 2016 at 11:16:15PM +0200, Martin Tóth wrote:
> Hi fellow haproxy users,
> 
> i just wanted to ask if new implementation of haproxy (implemented in v.
> 1.6.9) namespaces can work like this. I have Zabbix proxy daemon running
> inside network namespace in Linux, let???s say namespace is named
> ???customer???.
> I want to be able to run haproxy daemon in default linux namespace and be
> able to connect with haproxy to Zabbix proxy demon running inside own
> namespace. Is this possible ?
> 
> My config :
> 
> namespace_list
>   namespace customer
> 
> frontend customer
>   mode tcp
>   bind 10.0.0.2:10001 accept-proxy # this is IP and port on host 
> (10.0.0.2 - linux server IP) where i should connect when i want to reach 
> customer Zabbix proxy daemon
>   default_backend serverlist
> 
> backend serverlist
>   mode tcp
>   server s1 10.8.1.4:10050 namespace customer # this is zabbix proxy 
> dameon
> 
> It did not found any related example of configuration or more than one page
> of documentation. 

It should work like this. I've used it just for a test recently, to see
if it was possible to isolate a daemon into a network-less namespace (no
NIC except "lo"), and with haproxy connecting into that namespace. And
yes, it works. I'm not a namespace user at all so I had to use "ip netns"
with the man page opened and after trial and error I managed to make it
work.

At least you need to enter your customer namespace and issue
"netstat -ltnp" to ensure that your zabbix server is properly listening
to incoming connections, otherwise it will obviously never work.

Hoping this helps,
Willy



haproxy - namespece implementation and usage

2016-09-17 Thread Martin Tóth
Hi fellow haproxy users,

i just wanted to ask if new implementation of haproxy (implemented in v. 1.6.9) 
namespaces can work like this. I have Zabbix proxy daemon running inside 
network namespace in Linux, let’s say namespace is named “customer”.
I want to be able to run haproxy daemon in default linux namespace and be able 
to connect with haproxy to Zabbix proxy demon running inside own namespace. Is 
this possible ?

My config :

namespace_list
namespace customer

frontend customer
mode tcp
bind 10.0.0.2:10001 accept-proxy # this is IP and port on host 
(10.0.0.2 - linux server IP) where i should connect when i want to reach 
customer Zabbix proxy daemon
default_backend serverlist

backend serverlist
mode tcp
server s1 10.8.1.4:10050 namespace customer # this is zabbix proxy 
dameon

It did not found any related example of configuration or more than one page of 
documentation. 

Thanks a lot for reply.

Regards.

Martin