borchero/switchboard

Support for HostRegexp() rule

mamiu opened this issue · 3 comments

mamiu commented

@borchero It would be great to support the HostRegexp() rule.

Unfortunately switchboard can't generate a certificate for every possible string that would match the HostRegexp() rule, so we need a different approach here.

Since Traefik already has a syntax to provide domain names for certificates (via spec.tls.domains) it would be great if switchboard supported domains listet in the spec.tls.domains section as well (especially when there's no Host() rule provided).

For example:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: foo
  namespace: bar
spec:
  entryPoints:
  - websecure
  routes:
  - kind: Rule
    match: HostRegexp(`{www:(www.)?}example.{tld:(com|net)}`)
    services:
    - name: example-website
      port: 8080
  tls:
    secretName: supersecret
    domains:
    - main: example.com
      sans:
      - example.net
      - www.example.com
      - www.example.net

Do you switchboard could support such IngressRoutes as well?


And once again:
Echt hammer Projekt! Vielen Dank dafür.
Werds auf jeden Fall diese oder nächste Woche mal ausprobieren.
Schöne Grüße aus Australien.

That seems very reasonable ;) if one specifies .spec.tls.domains, would you (1) overwrite any domains found in Host rules or would you (2) merge them? I would definitely go for option (1), but if you have any use case for option (2), let me know.


Und sehr gerne, freut mich wirklich, dass es so gut ankommt ;)

mamiu commented

I'd also go with option (1) to get a more predictable behavior and to avoid confusion.

BTW: Great job your PR. Looks like you basically refactored the entire project. 😃👍

All right, I'll merge the PR tomorrow!

And thanks 😄 there was more interest in the project that I anticipated, so I wanted to make future changes easier... 😄