Skip to content
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

Adding peers and stick-table feature #296

Open
eduardodoria opened this issue Jan 31, 2019 · 3 comments
Open

Adding peers and stick-table feature #296

eduardodoria opened this issue Jan 31, 2019 · 3 comments

Comments

@eduardodoria
Copy link

Hello, I trying to config HAProxy with stick-table feature. To make this work I'm using config-backend annotation, like this:

ingress.kubernetes.io/config-backend: |
stick-table type string len 64 size 1m expire 8h
stick store-response res.cook(JSESSIONID)
stick match req.cook(JSESSIONID)

But I'm having trouble because we have multiple HAProxy instances and they don't share the table in memory. Also, if any pod changes, HAProxy need to reload and loses the table.

Looking HAProxy docs I found "peers" feature, that I can use to share stick-table between instances, like this:

peer haproxy1 192.168.0.1:1024
peer haproxy2 192.168.0.2:1024
peer haproxy3 10.2.0.1:1024

It's easy to add this in template with fixed servers, but how could I configure the template to list all HAProxy instances IP and add a line for each?

@terrafying
Copy link

terrafying commented Oct 28, 2019

This would be much easier if peers worked with resolvers - as far as I can tell, it only takes IP's
Alternatively, if you're using host network and your nodes don't change, you could just list all your nodes' IPs in the config

@kadambkaluskar
Copy link

any update on this feature request?

@jcmoraisjr
Copy link
Owner

Hi, planning to add shared tables for rate/max/etc limits, btw already did some poc and tests with peers, but we've at least gateway api and control plane / data plane separation as priorities for now.

Anyway maybe adding some templating and var expansion in the config snippets seem to add some value for one that wants to make the peer configuration themselves. How does it sound? I can run a quick poc on that just to confirm if it's as simple as it seems to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants