haproxy_config.macro 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {% macro haproxy_config(container_names, values) -%}
  2. defaults
  3. timeout connect 10s
  4. timeout client 150s
  5. timeout server 150s
  6. mode tcp
  7. frontend dssys_admin
  8. maxconn 100
  9. bind :4404 name dsadmin
  10. default_backend dssys_nodes
  11. frontend dssys_client
  12. maxconn 3000
  13. bind :4401 name dscln
  14. default_backend dssys_servers
  15. frontend dssys_group_client
  16. maxconn 3000
  17. bind :4409 name dsgroup
  18. default_backend dssys_groups
  19. {% if values.network.billing_port.bind_mode %}
  20. frontend dssys_billing_client
  21. maxconn 100
  22. bind :4415 name dsbilling
  23. default_backend dssys_billing
  24. {% endif %}
  25. backend dssys_nodes
  26. balance leastconn
  27. {%- for c in container_names %}
  28. server {{ c }} {{ c }} send-proxy-v2 check inter 4s port 4404
  29. {%- endfor %}
  30. backend dssys_servers
  31. balance leastconn
  32. {%- for c in container_names %}
  33. server {{ c }} {{ c }} send-proxy-v2 check inter 4s port 4401
  34. {%- endfor %}
  35. backend dssys_groups
  36. balance leastconn
  37. {%- for c in container_names %}
  38. server {{ c }} {{ c }} send-proxy-v2 check inter 4s port 4409
  39. {%- endfor %}
  40. {% if values.network.billing_port.bind_mode %}
  41. backend dssys_billing
  42. balance leastconn
  43. {%- for c in container_names %}
  44. server {{ c }} {{ c }} send-proxy-v2 check inter 4s port 4415
  45. {%- endfor %}
  46. {% endif %}
  47. {% endmacro %}