Skip to content

Determine how best to store KCM persistent data #2

Closed

Description

@munnerz

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? 😄

/cc @luna-duclos @whereisaaron

Activity

  1. luna-duclos commented on May 24, 2017

    @luna-duclos

    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 ?

  2. whereisaaron commented on May 24, 2017

    @whereisaaron
    Contributor

    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.

  3. munnerz commented on May 24, 2017

    @munnerz
    MemberAuthor

    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

  4. munnerz commented on May 24, 2017

    @munnerz
    MemberAuthor

    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.

  5. whereisaaron commented on May 25, 2017

    @whereisaaron
    Contributor

    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

    And/or specify in the Certificate TPR:

    spec:
     email: "[email protected]"
    

    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)

  6. munnerz commented on Jul 22, 2017

    @munnerz
    MemberAuthor

    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.

  7. added a commit that references this issue on Oct 11, 2018
  8. added a commit that references this issue on Oct 15, 2018
  9. added 2 commits that reference this issue on Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions