Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

NBSRV rule for an APP to failover Haproxy #651

@raghu999

Description

@raghu999

Hi We want to use nbsrv for few apps to failover the haproxy , We tried adding via label "HAPROXY_0_FRONTEND_HEAD": " \nfrontend {backend}\n acl mobile_fail nbsrv(backend) lt 1/n monitor fail if mobile_fail/n”, But once we stop the application the acl is also getting removed from the haproxy config(I think this is working as designed) which will not work for our usecase.

As we do not want the config to be removed after the app is suspended (or) destroyed we added the same rule in the globalconfig using HAPROXY_HTTPS_FRONTEND_HEAD template.

frontend marathon_https_in
  bind *:443 ssl {sslCerts}
  mode http
  acl mobile_fail nbsrv(mobile_10166) lt 1
  monitor fail if mobile_fail
  monitor-uri /vip_status

The template is working as expected and getting reflected in the haproxy config, But once we stop the mobile app marathon-lb stops working with the following error and is failing to reload the configs for other applications.

2019-10-02 16:59:24,061 marathon_lb: checking config with command: ['haproxy', '-f', '/tmp/tmplm9fj4db', '-c']
[ALERT] 274/165924 (212) : parsing [/tmp/tmplm9fj4db:105] : unable to find backend 'mobile_10166' referenced in arg 1 of ACL keyword 'nbsrv' in proxy 'marathon_https_in'.
[ALERT] 274/165924 (212) : Fatal errors found in configuration.
2019-10-02 16:59:24,288 marathon_lb: haproxy returned non-zero when checking config
2019-10-02 16:59:24,288 marathon_lb: skipping reload: config/map not valid
2019-10-02 16:59:24,288 marathon_lb: got apps ['/capsre-marathon-lb-v1.12.0']
2019-10-02 16:59:24,297 marathon_lb: generating config
2019-10-02 16:59:24,297 marathon_lb: HAProxy dir is /marathon-lb
2019-10-02 16:59:24,297 marathon_lb: Unexpected error!
Traceback (most recent call last):
  File "/marathon-lb/marathon_lb.py", line 1729, in make_config_valid_and_regenerate
    group_https_by_vhost)
TypeError: generateAndValidateTempConfig() takes 5 positional arguments but 6 were given

Can someone please help us here to understand if this feature is supported by marathon-lb.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions