Repository navigation
Cluster scoped Issuer support - #101
Conversation
d560add to
dc608f7
Compare
e1cc84c to
5a3b42a
Compare
aed23b7 to
7fffd67
Compare
|
I think with some additional work, it'd also be possible to refactor out the To do this, we'll need to make the control loops convert Issuer resources to GenericIssuer's early on. This may lead to us not being able to validate extensively in future however, so I've avoided it for now. |
|
I think not having namespaces in the references of Issuers is an acceptable trade-off for keep things simple (esp. in the various Issuer implementations). The cli flag for specifying a namespace makes sense to me. Would you set the cert-manager namespace as a default for that? For the |
| defaultNamespace = "" | ||
| defaultAPIServerHost = "" | ||
| defaultNamespace = "" | ||
| defaultClusterResourceNamespace = "kube-system" |
There was a problem hiding this comment.
Can we default to the current namespace instead? e.g. /var/run/secrets/kubernetes.io/serviceaccount/namespace
There was a problem hiding this comment.
Just remembered this comment after merging. I've opened #103
|
I agree, Maybe we could just be more "magic" in issuer selection - leave it as This does mean it's:
All that said, I suspect most peoples use-case for |
I also agree. I probably don't have enough context, but I wonder whether Maybe, we should consider having non-namespaced issuers, and per-namespace issuer binding of some sort. Perhaps, this is not dissimilar from In fact, I'd consider making |
|
A suggestion from @dippynark - RBAC uses a apiVersion: certmanager.k8s.io/v1alpha1
kind: Certificate
metadata:
name: test-example-com
namespace: test-ns
spec:
secretName: test-example-com
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuerThe default kind would then be an Any thoughts on that? It's probably clearer for users to understand than the namespace "" vs nil case. For reference, this PR does not introduce Certificates obtaining certs from Issuers in other namespaces, it simply introduces a non-namespaced issuer resource. Using a |
|
I vote for modeling this after RBAC, it would make a lot of sense and the
nature of the problem seems related.
It is okay to have only one kind for the time being, and as the API
evolves, in the future versions there may be more then one kind of issuers,
perhaps for different cert formats, or even certs that require manual
approval or something.
…On Fri, 6 Oct 2017, 8:25 am James Munnelly, ***@***.***> wrote:
A suggestion from @dippynark <https://github.com/dippynark> -
RBAC uses a kind field in order to disambiguate between ClusterRole and
Role - we could model it like so:
apiVersion: certmanager.k8s.io/v1alpha1
kind: Certificate
metadata:
name: test-example-com
namespace: test-ns
spec:
secretName: test-example-com
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
The default kind would then be an Issuer. Any other value would be
invalid.
Any thoughts on that? It's probably clearer for users to understand than
the namespace "" vs nil case. For reference, this PR does *not* introduce
Certificates obtaining certs from Issuers in other namespaces, it simply
introduces a non-namespaced issuer resource.
Using a kind field as above would potentially allow us to still support
crossing namespace boundaries in future if it makes sense (through the
addition of a namespace field)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#101 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPWSzfHP_kVH9nfs7grMY4H7rW1fNTjks5spkZbgaJpZM4PgFyn>
.
|
ab4069c to
7b30b80
Compare
|
I've updated this to use a |
This is an attempt at a ClusterIssuer resource.
It shares the same fields as an Issuer resource, including the same
IssuerSpecandIssuerStatus.To overcome issues with fields in the Issuer spec not containing namespace fields, the namespace to store resources in for ClusterIssuers is specified as a CLI flag to cert-manager itself. I'm not sure if this is an acceptable tradeoff, but it makes the addition of this feature much cleaner.
In order to support both types of issuer within the
pkg/issuerpackage, I have created aGenericIssuerinterface inpkg/apis/certmanager/v1alpha1/helper.go. This is probably not the best final resting place for this type.This also changes the Certificate spec so that the
spec.issuerfield is nowspec.issuerRef. A Certificate can reference a ClusterIssuer by setting thekindfield to 'ClusterIssuer'.The above resource would use the ClusterIssuer named
letsencrypt-prod.If a Certificate were to omit the
spec.issuerRef.Kindfield or set it to 'Issuer', it would use the Issuerletsencrypt-prodin the namespacetest-ns, e.g.:@mikebryant I'm keen to hear your feedback. This is actually surprisingly tricky to implement, between the API surface exposed to users and how we deal with the differences between the two types internally.
Closes #91
/cc @simonswine @mattbates @dippynark