You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Determine how best to store KCM persistent data #2
Currently, as far as I am aware, KCM stores some persistent state in boltdb.
Given kube-lego's current state of not needing persistent storage attached, it'd be preferable to create this as part of our API group and store it as a ThirdPartyResource.
What data exactly is being stored in BoltDB, and how/how frequently is it accessed? 😄
It's the renewal information for the certs. Technically, we could just resolve the challenge instead, which I'd prefer rather than storing (sensitive) renewal information in a place easy to access by other pods.
In an ideal world, we'd keep the persistent state, but make it optional, does that sound reasonable ?
The renewals support might be quite important due to Let's Encrypt rate limits. New or duplicate certificates transactions are tightly rate limited, but renewals are comparatively unlimited.
The BoltDB is also used to store the alt names for SAN certificates, so that you know which renewal information applies, when you have multiple different SAN certificates for the same primary domain name. The SAN certificates feature is also important to keep your transaction rate down, as recommended by Let's Encrypt in the page above.
The renewal information could be stored in Kubernetes Secrets, by naming a 'renewal secret' in an Ingress annotation or Certificate TPR. And it could be made optional by not naming a renewal Secret. This would keep the certificate service itself free of persistent storage.
kube-lego currently has a user account per instance, that is reused for all domains. What behaviour do we want to adopt here? I think it should be consistent between the implementations either way.
Would we be better to allow specifying an email address on the Certificate resource, and as an annotation on Ingress resources, and then creating an account per email?
We could keep users of both happy by then also allowing a default to be specified (which is currently a required parameter in kube-lego). If a user does not specify a default email, it is required that all Ingresses & Certificates specify an email.
A default with an option to specify it in the resource sounds like a good policy in general. We want a simple cert manager deployment to have to specify nothing but the domain name for the cert. And if no default, and none specified, then yes, no action.
KCM already has the option to specify the email address used for ACME registrations, you can set a default per instance:
-default-email - Default email address for ACME registrations, used if not specified in a resource annotation
stable.k8s.psg.io/kcm.email - The same as spec.email in Certificate Resources. Optional, if you set the -default-provider argument.
There are similar default-or-specify settings for the DNS provider and TLS Secret name. (Default TLS Secret name is the domain name with an optional per-instance prefix)
So certificate authorization URIs are now stored on Certificate objects, and user account URIs are stored on Issuer resources.
The corresponding private keys for these things are stored in Secret resources in the API server.
Interested to hear any feedback, especially around which values from Letsencrypt are & are not sensitive! From my understanding, the URIs are useless unless you have the user accounts private key anyway, so we should be okay.
Activity
luna-duclos commentedon May 24, 2017
It's the renewal information for the certs. Technically, we could just resolve the challenge instead, which I'd prefer rather than storing (sensitive) renewal information in a place easy to access by other pods.
In an ideal world, we'd keep the persistent state, but make it optional, does that sound reasonable ?
whereisaaron commentedon May 24, 2017
The renewals support might be quite important due to Let's Encrypt rate limits. New or duplicate certificates transactions are tightly rate limited, but renewals are comparatively unlimited.
https://letsencrypt.org/docs/rate-limits/
The BoltDB is also used to store the alt names for SAN certificates, so that you know which renewal information applies, when you have multiple different SAN certificates for the same primary domain name. The SAN certificates feature is also important to keep your transaction rate down, as recommended by Let's Encrypt in the page above.
The renewal information could be stored in Kubernetes Secrets, by naming a 'renewal secret' in an Ingress annotation or Certificate TPR. And it could be made optional by not naming a renewal Secret. This would keep the certificate service itself free of persistent storage.
munnerz commentedon May 24, 2017
At the moment it seems kcm creates a user account per domain on a certificate request (so if two certificates are for the same domain, the same user will be reused) (https://github.com/PalmStoneGames/kube-cert-manager/blob/master/processor.go#L436).
kube-lego currently has a user account per instance, that is reused for all domains. What behaviour do we want to adopt here? I think it should be consistent between the implementations either way.
/cc @simonswine
munnerz commentedon May 24, 2017
Would we be better to allow specifying an email address on the Certificate resource, and as an annotation on Ingress resources, and then creating an account per email?
We could keep users of both happy by then also allowing a default to be specified (which is currently a required parameter in kube-lego). If a user does not specify a default email, it is required that all Ingresses & Certificates specify an email.
whereisaaron commentedon May 25, 2017
A default with an option to specify it in the resource sounds like a good policy in general. We want a simple cert manager deployment to have to specify nothing but the domain name for the cert. And if no default, and none specified, then yes, no action.
KCM already has the option to specify the email address used for ACME registrations, you can set a default per instance:
-default-email- Default email address for ACME registrations, used if not specified in a resource annotationAnd/or specify in the Certificate TPR:
or specify in the Ingress annotation:
stable.k8s.psg.io/kcm.email- The same as spec.email in Certificate Resources. Optional, if you set the -default-provider argument.There are similar default-or-specify settings for the DNS provider and TLS Secret name. (Default TLS Secret name is the domain name with an optional per-instance prefix)
munnerz commentedon Jul 22, 2017
So certificate authorization URIs are now stored on Certificate objects, and user account URIs are stored on Issuer resources.
The corresponding private keys for these things are stored in Secret resources in the API server.
Interested to hear any feedback, especially around which values from Letsencrypt are & are not sensitive! From my understanding, the URIs are useless unless you have the user accounts private key anyway, so we should be okay.
# This is a combination of 2 commits.
# This is a combination of 2 commits.
update code review cert-manager#2
update code review cert-manager#2
Merge pull request cert-manager#2 from ndemeshchenko/sync_branch
Merge pull request cert-manager#2 from ndemeshchenko/sync_branch
adjust import order cert-manager#2
[release-1.19] bump go + deps to fix govulncheck issues