voyager icon indicating copy to clipboard operation
voyager copied to clipboard

Document how to use backend names for multiple hosts

Open tamalsaha opened this issue 6 years ago • 1 comments

https://github.com/appscode/voyager/issues/1187

tamalsaha avatar Jul 12 '18 11:07 tamalsaha

I did a cluster upgrade of kubernetes to 1.11.1 during which time I hit a snag where one explicitly named backend service was down and caused the generated haproxy config to be invalid and therefore was not updated even though other services were fine. It seems that for any backend service that is down results in the rules bit being skipped (rightly so) and the backend service being excluded.

I believe a better approach compared to what I described in #1187 is to add additional ACL rules that match the name/convention of the autogenerated rules. In this case all you need in the frontend rules section (for both ports, one shown) is

    - port: 443
      rules:
      - acl acl_primary.host.name  hdr_sub(host) -i additionaldomain.com

Where the primary.host.name is specified as the host: in the rules section. I'm also taking advantage of the hdr_sub bit to allow any subdomain for the additional domains.

While I haven't tested/experienced the failure scenario of any service since, the acl / rule bit works well. It also means you don't need to explicitly define the backend name and things still just work, with the yaml file being much simpler. The worst that could happen is you define an ACL that has no effect.

ocdi avatar Jul 27 '18 01:07 ocdi