cert-manager icon indicating copy to clipboard operation
cert-manager copied to clipboard

[feat] when helm set `installCRDs: true`. crds.yaml file must be pre-install and pre-upgrade

Open dongjiang1989 opened this issue 2 years ago • 11 comments

Pull Request Motivation

When cert-manager as sub-charts and set installCRDs: true . crds.yaml file must be pre-install and pre-upgrade

like: https://craftech.io/blog/release-lifecycle-management-with-helm/

Kind

/kind feature

Release Note

When helm set `installCRDs: true`.  crds.yaml file must be `pre-install` and `pre-upgrade`

dongjiang1989 avatar Jun 29 '23 09:06 dongjiang1989

Hi @dongjiang1989. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

jetstack-bot avatar Jun 29 '23 09:06 jetstack-bot

@inteon PTAL

dongjiang1989 avatar Jul 01 '23 02:07 dongjiang1989

xref: https://github.com/cert-manager/cert-manager/pull/5777

inteon avatar Jul 01 '23 16:07 inteon

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Send feedback to jetstack. /lifecycle stale

jetstack-bot avatar Sep 29 '23 16:09 jetstack-bot

/remove-lifecycle stale

inteon avatar Sep 29 '23 16:09 inteon

Bump. Came across this today.

KrisJohnstone avatar Oct 12 '23 00:10 KrisJohnstone

Bump. Came across this today.

Can you use this PR to solve your problem? @KrisJohnstone

dongjiang1989 avatar Oct 12 '23 01:10 dongjiang1989

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from inteon. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

jetstack-bot avatar Feb 02 '24 12:02 jetstack-bot

@dongjiang1989 I did some experimentation based on your PR. It does not seem to be possible to use the cert-manager CRDs when cert-manager is a dependency of your Helm chart, even with these changes applied.

I get the following error:

$ helm install test .
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: resource mapping not found for name: "example-com" namespace: "" from "": no matches for kind "Certificate" in version "cert-manager.io/v1"
ensure CRDs are installed first

My Chart.yaml looks like this:

apiVersion: v2
name: example_chart
description: A Helm chart with cert-manager as subchart
type: application
version: 0.1.0
appVersion: "0.1.0"
dependencies:
  - name: cert-manager
    version: v1.14.0
    repository: "file://./cert-manager"
    alias: cert-manager
    condition: cert-manager.enabled

And the chart contains a single Certificate resource.

Is there another reason why you would add these annotations other than trying to use created CR objects of the type defined in the CRD?

NOTE: we have solved this problem in the past by using Helmfile https://github.com/helmfile/helmfile

inteon avatar Feb 02 '24 15:02 inteon

@inteon In your environment, what is the certmanager version? Please execute kubectl api-versions | grep "certmanager"

dongjiang1989 avatar Feb 04 '24 09:02 dongjiang1989

@inteon In your environment, what is the certmanager version? Please execute kubectl api-versions | grep "certmanager"

I was just installing from master. Before installation, I do not have any CRDs installed, after installation, I have the following CRDs:

$ kubectl api-versions | grep "cert-manager"
acme.cert-manager.io/v1
cert-manager.io/v1

Could you explain what this PR tries to fix, eg. using a sample chart that has this problem and for which the problem is fixed after making the provided changes?

inteon avatar Feb 05 '24 13:02 inteon

PR needs rebase.

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/test-infra repository.

jetstack-bot avatar Feb 23 '24 00:02 jetstack-bot

Will close this PR as it does not seem to fix the issue. Feel free to share an example chart that is able to install CRs thanks to this PR, then I'll re-open this PR.

inteon avatar Apr 23 '24 09:04 inteon