Issue replacing the apache2 charm with the haproxy charm in a reverse proxy scenario.

Jay Wren jay.wren at canonical.com
Tue Feb 14 19:38:47 UTC 2017


Hello,

I have recently had the need to replace an apache2 ssl termination and
proxy/rewrite reverse proxy system with haproxy. I was hoping I'd be able
to configure the haproxy charm to do all the things that we were doing with
apache2 and its vhost_https_template config. All seemed to work well (huge
thanks to juju and charm authors) until the haproxy ssl termination and
proxy charm was also proxying another haproxy charm. I know this seems
strange, but its an interim config until we collapse our haproxy charms.

Moving from: apache2 -> haproxy-a -> service-a
                     -> haproxy-b -> service-b
                     -> service-c (direct, no haproxy)
                     ... (10 different services)

To:   haproxy -> haproxy-a -> service-a
              -> haproxy-b -> service-b
              -> service-c (direct, no haproxy)
              ... (10 different services)

The issue seems to be that the apache2 charm expects a relation key named
"all_services" and haproxy provides that. haproxy expects a relation key
named "services" but does not provide that.

$ juju run --unit apache2/2 'relation-get -r balancer:93 -
blues-identity-haproxy/2 '
all_services: |
  - server_options: &id001 [check inter 2000 rise 2 fall 5 maxconn 500]
    servers:
    - - blues-identity-2-8082
      - 10.142.0.16
      - '8082'
      - *id001
    service_host: 0.0.0.0
    service_name: blues-identity
    service_options: [mode http, balance url_param waitid]
    service_port: 83
hostname: juju-b4d3a0-41.c.jaas-001.internal
port: "80"
private-address: 10.142.0.15

I've filed a bug, https://bugs.launchpad.net/charm-haproxy/+bug/1664672 and
proposed a fix.
https://code.launchpad.net/~evarlast/charm-haproxy/alias-all_services-services/+merge/317254

Is this intended or is this an oversight or accident?

Thanks,
--
Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20170214/6b2131d9/attachment.html>


More information about the Juju mailing list