janeczku / rancher-letsencrypt

:cow: Rancher service that obtains and manages free SSL certificates from the Let's Encrypt CA
Apache License 2.0
326 stars 114 forks source link

Get domains list automatically from load-balancer service #67

Open akhy opened 7 years ago

akhy commented 7 years ago

As services grow in number, it become more tedious to add new service domains to DOMAINS var in letsencrypt stack. In my use case, most of the time, domains added to letsencrypt get added to (cattle) load balancer too. So why not making it automatically fetch domains from load balancer?


I'm not yet familiar with rancher-letsencrypt codebase, but here's roughly my implementation idea:

additional env vars with sample value:

I have found that we can query certain lb's upstream hosts by making requests to Cattle's internal metadata service:

curl http://rancher-metadata.rancher.internal/latest/stacks/<stackname>/services/<lbservice>/lb_config/port_rules/<number>/hostname

What do you think? Any edge cases we should be cautious about?

karael commented 5 years ago

Any update ?