Repository navigation
Added certificate owner ref field - #5158
RomanenkoDenys wants to merge 8 commits into
Conversation
|
Hi @RomanenkoDenys. Thanks for your PR. I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
be271d9 to
0717496
Compare
We shouldn't set owner references to cert-manager objects if we don't want to delete secrets too. This way, after the PXC cluster is deleted issuers, certificates and their secrets will remain intact in the cluster. If users want to cleanup objects created for SSL, we introduce a new finalizer: `delete-ssl`. If this finalizer is set, the operator will delete secrets, certificates and issuers. Unfortunately, cert-manager doesn't set owner reference to the secret it created and this behaviour can only configured by command line flag in the controller. Since we can't control how users deploy cert-manager to their clusters, we shouldn't rely on this feature and cleanup certificates and secrets altogether. Hopefully, cert-manager/cert-manager#5158 will merged and we can configure this behaviour on certificate level.
We shouldn't set owner references to cert-manager objects if we don't want to delete secrets too. This way, after the PXC cluster is deleted issuers, certificates and their secrets will remain intact in the cluster. If users want to cleanup objects created for SSL, we introduce a new finalizer: `delete-ssl`. If this finalizer is set, the operator will delete secrets, certificates and issuers. Unfortunately, cert-manager doesn't set owner reference to the secret it created and this behaviour can only configured by command line flag in the controller. Since we can't control how users deploy cert-manager to their clusters, we shouldn't rely on this feature and cleanup certificates and secrets altogether. Hopefully, cert-manager/cert-manager#5158 will merged and we can configure this behaviour on certificate level.
|
Hi thank you for the PR. I haven't looked at the contents yet, a couple thoughts:
|
|
Hi, thank you for reply.
We use Corresponding secret - Let's change certificate if i restore
Yes, wi will discuss on the next biweekly meet.
Yes, let's discuss later. Thank you ! |
0717496 to
1ac262c
Compare
1ac262c to
cc830e4
Compare
* K8SPXC-1030: Don't delete cert-manager certs by default We shouldn't set owner references to cert-manager objects if we don't want to delete secrets too. This way, after the PXC cluster is deleted issuers, certificates and their secrets will remain intact in the cluster. If users want to cleanup objects created for SSL, we introduce a new finalizer: `delete-ssl`. If this finalizer is set, the operator will delete secrets, certificates and issuers. Unfortunately, cert-manager doesn't set owner reference to the secret it created and this behaviour can only configured by command line flag in the controller. Since we can't control how users deploy cert-manager to their clusters, we shouldn't rely on this feature and cleanup certificates and secrets altogether. Hopefully, cert-manager/cert-manager#5158 will merged and we can configure this behaviour on certificate level. * fix tests Co-authored-by: Viacheslav Sarzhan <[email protected]>
|
I'd also like to discuss the API surface for this - I think something more like |
|
I have created the design document 20220720-per-certificate-owner-ref.md with the aim to continue the discussion about the API surface. Update: I will be on vacation from 30 July to 15 August 2022. |
* K8SPXC-1030: Don't delete cert-manager certs by default We shouldn't set owner references to cert-manager objects if we don't want to delete secrets too. This way, after the PXC cluster is deleted issuers, certificates and their secrets will remain intact in the cluster. If users want to cleanup objects created for SSL, we introduce a new finalizer: `delete-ssl`. If this finalizer is set, the operator will delete secrets, certificates and issuers. Unfortunately, cert-manager doesn't set owner reference to the secret it created and this behaviour can only configured by command line flag in the controller. Since we can't control how users deploy cert-manager to their clusters, we shouldn't rely on this feature and cleanup certificates and secrets altogether. Hopefully, cert-manager/cert-manager#5158 will merged and we can configure this behaviour on certificate level. * fix tests Co-authored-by: Viacheslav Sarzhan <[email protected]>
* K8SPXC-1030: Don't delete cert-manager certs by default We shouldn't set owner references to cert-manager objects if we don't want to delete secrets too. This way, after the PXC cluster is deleted issuers, certificates and their secrets will remain intact in the cluster. If users want to cleanup objects created for SSL, we introduce a new finalizer: `delete-ssl`. If this finalizer is set, the operator will delete secrets, certificates and issuers. Unfortunately, cert-manager doesn't set owner reference to the secret it created and this behaviour can only configured by command line flag in the controller. Since we can't control how users deploy cert-manager to their clusters, we shouldn't rely on this feature and cleanup certificates and secrets altogether. Hopefully, cert-manager/cert-manager#5158 will merged and we can configure this behaviour on certificate level. * fix tests Co-authored-by: Viacheslav Sarzhan <[email protected]>
3ecbc69 to
eabb20a
Compare
|
Hi 👋 I just wanted to let you know that I'll be on PTO from Tue 27 June to Sun 23 July. You can contact @inteon if a review is needed earlier. Have a great weekend and a good month of July! |
Hi, thanks ! Let's see you later! |
32dd28f to
6694245
Compare
Added cleanupPolicy certificate field Signed-off-by: Denis Romanenko <[email protected]> Co-authored-by: Maël Valais <[email protected]>
Signed-off-by: Maël Valais <[email protected]>
Signed-off-by: Denis Romanenko <[email protected]>
Signed-off-by: Denis Romanenko <[email protected]>
Signed-off-by: Denis Romanenko <[email protected]>
Signed-off-by: Denis Romanenko <[email protected]>
Signed-off-by: Denis Romanenko <[email protected]>
Signed-off-by: Denis Romanenko <[email protected]>
6694245 to
e571a9e
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maelvls The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@RomanenkoDenys: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Issues go stale after 90d of inactivity. |
|
Stale issues rot after 30d of inactivity. |
|
/remove-lifecycle rotten |
|
This looks to solve: #7041 |
|
Issues go stale after 90d of inactivity. |
|
@RomanenkoDenys: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
Stale issues rot after 30d of inactivity. |
|
Rotten issues close after 30d of inactivity. |
|
@cert-manager-bot: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@maelvls, good afternoon. |
Pull Request Motivation
The cert-manager has the ability to set the owner reference field in generated secrets. We can enable this option globally by setting the
--enable-certificate-owner-refcli flag.We want to configure it in more detail, at the certificate level. So we add a new field to the certificate CRD,
cleanupPolicy.When this field is set to
Delete, the owner reference is always created on the Secret resource and the secret will be automatically removed when the certificate resource is deleted.When this field is set to
Never, the owner reference is never created on the Secret resource and the secret will not be automatically removed when the certificate resource is deleted.Also, we add cli flag
--default-secret-cleanup-policyto set default policy for certificates if certificate CRD fieldcleanupPolicyis not set.--enable-certificate-owner-refcli flag is declared as deprecated but takes precedence over--default-secret-cleanup-policyfor backward compatibility.This option is useful if the cluster contains both prod environments, where secrets should not be deleted, and development environments, where secrets should be deleted all the time.
Kind
Release Note