Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subdomain certs #274

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Subdomain certs #274

wants to merge 3 commits into from

Conversation

sed-i
Copy link
Contributor

@sed-i sed-i commented Oct 19, 2023

Issue

The TLS cert solution was designed with only path routing in mind.
With subdomain routing, traefik is unable to match a domain to a cert.

Solution

  • Refactor to have a cert per app (IPA) or per unit (IPU).
    • when ingress relation (unit) joins/departs, send CSR/CRR on behalf of the unit
    • when routing mode changes from subdomain to path, CRR everything
    • when routing mode changes from path to subdomain, CSR everything
  • Keep using cert_handler as-is for the bare hostname cert. Should keep it even for subdomain routing, to be able to reach traefik api endpoints and metrics endpoint.

Fixes #244.

Context

Testing Instructions

Release Notes

Copy link
Contributor

@ghislainbourgeois ghislainbourgeois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some comments, but I agree with the decision and chosen approach.

Copy link

@gregory-schiano gregory-schiano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/charm.py Outdated
if self._routing_mode is _RoutingMode.path:
return self.external_host
else: # _RoutingMode.subdomain
prefix = "somehow, from reldata"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PietroPasotti would you be able to help out obtaining the prefix using the new schema classes?
I imagine #269 may have an impact on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subdomain routing mode does not work properly with TLS certificates
4 participants