-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Document the TLS with ACME case #4654
Conversation
Oof this feels bad, perhaps a new boolean instead? Idk. This will work short term, but I think we should come up with a better way to do this before GA 😅 |
yeah, it's far from ideal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When we did the kubernetes crd implementation, we forgot to test the case for when one wants TLS, but handled with Let's Encrypt, i.e. without having to provide a Kubernetes Secret. We assumed it would be enough to provide (in YAML) a tls object with no field set, which would get us a non-nil IngressRouteSpec.TLS, allowing us to use IngressRouteSpec.TLS as the sentinel for whether TLS should be enabled. However, as IngressRouteSpec.TLS is a pointer, a tls object with no fields set will actually result in IngressRouteSpec.TLS being nil. This means at least one of the fields of the YAML tls object must exist. Therefore, we now use the secretName field value (for now, as it is the only field anyway) as the sentinel for whether Let's Encrypt should be used. This PR documents the above behavior, and adds a unit test for it. In addition, this PR fixes a related bug in the ACME provider: when a router is not configured with TLS enabled, the ACME provider does not try anymore to generate a (useless) certificate for the corresponding domain.
Maybe is just a visualisation issue, but the raw dashboard api seems to expect ❯ curl -sSL http://traefik-v2:8080/api/rawdata | jq . {
"ACME": {
"HTTP": {},
"TCP": {},
"TLSOptions": null,
"TLSStores": null
},
"kubernetescrd": {
"HTTP": {
"routers": {
"default/cats-fe7c78d104ccea9b6f28": {
"entryPoints": [
"web"
],
"middlewares": [
"default/rmpath"
],
"service": "default/cats-fe7c78d104ccea9b6f28",
"rule": "Path(`/cache`)"
},
... |
What does this PR do?
When we did the kubernetes crd implementation, we forgot to test the
case for when one wants TLS, but handled with Let's Encrypt, i.e.
without having to provide a Kubernetes Secret. We assumed it would be
enough to provide (in YAML) a tls object with no field set, which would
get us a non-nil IngressRouteSpec.TLS, allowing us to use
IngressRouteSpec.TLS as the sentinel for whether TLS should be enabled.
However, as IngressRouteSpec.TLS is a pointer, a tls object with no
fields set will actually result in IngressRouteSpec.TLS being nil. This
means at least one of the fields of the YAML tls object must exist.
Therefore, we now use the secretName field value (for now, as it is
the only field anyway) as the sentinel for whether Let's Encrypt should
be used.
This PR documents the above behaviour, and adds a unit test for it.
In addition, this PR fixes a related bug in the ACME provider: when a
router is not configured with TLS enabled, the ACME provider does not
try anymore to generate a (useless) certificate for the corresponding
domain.
Motivation
As described above, documenting this common case was needed.
More
Additional Notes
Co-authored-by: Julien Salleyron julien.salleyron@gmail.com