Hi,
I have been through the documentation and at some point they state "kubernetes users must provide certificates through secrets", but, how do I achieve this?
I have a ConfigMap with the configuration I want to apply to traefik:
But now I don't know how to present the certificate to it. Basically I have a wildcard certificate that I would like to apply to all the configurations by default.
Hi @dduportal, thanks, I did all the static and dynamic config and it looks fine to me, but I am using kubernetes ingress but not the CRD ingressroute and it seems it ingress doesn't accept it.
If you are using v2.0, it is recommend to switch to CRD IngressRoute as v2 does not support annotations.
However what you want to achieve should still work, if you enable the directive tls and specify only the hosts (please look, at the official Kubernetes documentation https://kubernetes.io/docs/concepts/services-networking/ingress/#tls). Don't specify any secretName and it should be ok.
Let us know and share some examples with us if it does not work.
Hi,
Thanks, I would then consider switching to IngresRoute ( Actually I switched back because I want to use official helm charts and I don't know a way to get it working with CRD )
It seems the problem comes now with:
level=error msg="Cannot start the provider *file.Provider: toml: cannot load TOML value of type map[string]interface {} into a Go slice"
Can you share the Traefik's deployment file, and the full configmap mapping to traefik.toml please? As this is only partial information, but it looks like there is a syntax error in your TOML file.
But the issue was the fact that tls.certificates required 2 pairs of brackets (and not only one),
to express it's an element of a collection (and not a single directive).
[tls.certificates] -> [[tls.certificates]].
In your latest message, you fixed it, it's why it is working
With this configuration, I can access services that uses the default store but not the ones that should be using opsk1 store. ( I am assuming that when typing https://grafana.ops-k1.domain.de it will use the appropriate certificate)
Those are the logs, which I am not sure I understand:
time="2019-11-05T17:15:46Z" level=debug msg="No default certificate, generating one" tlsStoreName=opsk1
time="2019-11-05T17:15:46Z" level=debug msg="Adding certificate for domain(s) *.domain.de"
time="2019-11-05T17:15:46Z" level=debug msg="Adding certificate for domain(s) *.ops-k1.domain.de"
time="2019-11-05T17:15:46Z" level=debug msg="No store is defined to add the certificate MIIKWDCCCUCgAwIBAgIMISGefWrCZCQykHsfSqMA0GCSqGSIb3DQ, it will be added to the default store."
I see what is going on. I had enabled strict SNI and since it tries to serve *.domain.de it doesn't work. even I have *.ops-k1.domain.de certificate too.
Any idea why Traefik cannot pick up the right one?
Now I have added the *.ops-k1.domain.de certificate to default store and it works, but what I still don't get is how handle different certs in different stores.
@dduportal not really, is just that I understood somehow that different stores were designed to split certificates. But I can definitely use this single store. I still would like to know why several stores are available but only the default can be used.
My guess is that this is a foreseen feature, that required the Traefik foundation to be ready to handle it,
but the elements to expose this feature to end user have not been done (for whatever reason: no time, no opportunity, no stability, whatever).
By the way, the section "Reference" of the documentation is generated manually: it explains why you see "excerpts" of configuration.
My guess that is has to do with the paid version. In the Enterprise version you'll be able to have more KV stores, such as Consul or Etcd, which would be separate from file. The community version is not getting them, so one store only. To repeat - this is a guess.