Skip to content

WIP: Allow ignoring ACME challenge self check failures - #2783

Closed
anton-johansson wants to merge 1 commit into
cert-manager:masterfrom
anton-johansson:acme-self-check-failure-policy
Closed

anton-johansson wants to merge 1 commit into
cert-manager:masterfrom
anton-johansson:acme-self-check-failure-policy

Conversation

@anton-johansson

@anton-johansson anton-johansson commented Apr 6, 2020 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

This is the implementation for design document #2772. It allows us to control failure policies for the ACME self check. The default policy keeps the existing functionality by waiting indefinitely, but it can now also be configured to be ignored, leading to the request being sent to the certificate provider anyway.

Which issue this PR fixes:

Fixes #1292

Special notes for your reviewer:

My first contribution to the project, so as much feedback as possible is much appreciated!

There's a lot of redundant changes in zz_generated.conversion.go, but this is generated, so I'm assuming this is OK.

Release note:

Allow ignoring ACME challenge self check failures

To do:

  • e2e test coverage
  • manual/functional tests

@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 6, 2020
@jetstack-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anton-johansson
To complete the pull request process, please assign joshvanl
You can assign the PR to them by writing /assign @joshvanl in a comment when ready.

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

Details 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

Copy link
Copy Markdown
Contributor

Hi @anton-johansson. Thanks for your PR.

I'm waiting for a jetstack or 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.

Details

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 jetstack-bot added the area/acme Indicates a PR directly modifies the ACME Issuer code label Apr 6, 2020
@jetstack-bot
jetstack-bot requested review from JoshVanL and munnerz April 6, 2020 09:45
@jetstack-bot jetstack-bot added area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration area/testing Issues relating to testing labels Apr 6, 2020

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @anton-johansson

I see that this is a WIP branch so apologies if I'm jumping the gun.
The changes look good so far. Just a couple of typos and suggestions which you can take or leave.
Let me know if the branch is ready for testing and I'll compile and run it locally.

-RichardW.

Comment thread pkg/apis/meta/v1/types.go Resolved
Comment thread pkg/apis/meta/v1/types.go Resolved
Comment thread pkg/apis/meta/v1/types.go Resolved
Comment thread pkg/controller/acmechallenges/sync.go Resolved
Comment thread pkg/controller/acmeorders/sync_test.go Resolved
Comment thread pkg/internal/apis/meta/types.go Resolved
Comment thread pkg/internal/apis/meta/types.go Resolved
@jetstack-bot jetstack-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2020
Comment thread pkg/apis/meta/v1/types.go Resolved
@munnerz munnerz added this to the v0.15 milestone Apr 14, 2020
@anton-johansson
anton-johansson force-pushed the acme-self-check-failure-policy branch from 07ab964 to eb3ee37 Compare April 14, 2020 12:20
@jetstack-bot jetstack-bot added dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 14, 2020
@anton-johansson
anton-johansson force-pushed the acme-self-check-failure-policy branch from eb3ee37 to a6f225d Compare April 14, 2020 12:21
@jetstack-bot jetstack-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 14, 2020
@anton-johansson

Copy link
Copy Markdown
Contributor Author

Thanks @anton-johansson

I see that this is a WIP branch so apologies if I'm jumping the gun.
The changes look good so far. Just a couple of typos and suggestions which you can take or leave.
Let me know if the branch is ready for testing and I'll compile and run it locally.

-RichardW.

Hey @wallrj. No worries at all, I appreciate the feedback. Thanks! I'll get it up and running locally first, to avoid unnecessary testing round-trips for you guys.

@anton-johansson
anton-johansson force-pushed the acme-self-check-failure-policy branch from a6f225d to 0c3cc66 Compare April 17, 2020 08:01
@jetstack-bot jetstack-bot removed the dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. label Apr 17, 2020
@jetstack-bot jetstack-bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Apr 17, 2020
Comment thread pkg/apis/acme/v1alpha2/types_issuer.go Resolved
@munnerz

munnerz commented Apr 17, 2020

Copy link
Copy Markdown
Member

I think this is related to what @munnerz said the other day. Making this field a pointer probably solves it. This is probably a good first step, even though @munnerz mentioned an overhaul of how defualt values work by using some kubebuilder annotation.

Yep - we actually cannot set CRD based default values yet which is a huge pain (because we have to use CRD v1 instead of v1beta1 for this).

If you mark this field as // +optional and include omitempty in the JSON tags, this issue should go away. We'll then need to modify every place that references this field to 'understand' the default value ("") and automatically use the correct option (WaitForever).

We can look at actually defaulting later, but until we can do CRD based defaulting this is going to be a pain point regardless. If you could be sure to make a note of the default value in the comment/description for the field though, it'll make things far easier for end-users and also for us when it comes to remembering to set up defaults properly 😄

Comment thread pkg/internal/apis/meta/types.go Resolved

// This policy will cause the ACME challenge self check response to be
// ignored and the request will always be sent to the certificate provider.
ACMESelfCheckFailurePolicyIgnore ACMESelfCheckFailurePolicy = "Ignore"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many times do we attempt the self check before we continue and ignore?

@anton-johansson anton-johansson Apr 17, 2020 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will only check one time, and therefore instantly sends the request to the certificate provider. This will be done too early, before the solver Pod and `Ingress' resources are ready... Ideas?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's definitely going to be problematic, and without a self-check-like heuristic it'll also be difficult for us to workaround.

So looking at this from a use-cases PoV, I see a few user stories:

  1. User has some form of hair-pin NAT issue, they 'know' the self check will pass if you give it 30s to propagate

  2. User has a custom ingress setup that requires special steps to check

For (2), we should allow users to 'bring their own' self check implementations, i.e. 'disable' the in-built one and have a controller perform the same action.

For (1), which is what I see this PR addressing, a simple time based heuristic may be better (i.e. try once, wait 30s, accept the challenge). That said, if we were to look at this from a world where we have (2) implemented, would it make most sense for this time based check to exist as a failurePolicy or as an alternative self check implementation altogether?

I'm not 100% sure either way as to how we should address this/what we should do - it'd be great to get your thoughts on it and anyone else's who needs something like this.

@anton-johansson
anton-johansson force-pushed the acme-self-check-failure-policy branch from 0c3cc66 to a3137ff Compare April 17, 2020 12:11
@munnerz munnerz modified the milestones: v0.15, Next Apr 27, 2020
@zbagdzevicius

Copy link
Copy Markdown

any progress on this PR ?

@anton-johansson

Copy link
Copy Markdown
Contributor Author

Hi @zbagdzevicius! Unfortunately I've had my hands full with work and personal stuff.

@jetstack-bot jetstack-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 7, 2020
@jetstack-bot

Copy link
Copy Markdown
Contributor

@anton-johansson: PR needs rebase.

Details

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.

@meyskens

meyskens commented Dec 3, 2020

Copy link
Copy Markdown
Contributor

Closing old stale PRs to keep an overview for the reviewers. Feel free to /reopen if work started on this again.

/close

@jetstack-bot

Copy link
Copy Markdown
Contributor

@meyskens: Closed this PR.

Details

In response to this:

Closing old stale PRs to keep an overview for the reviewers. Feel free to /reopen if work started on this again.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/acme Indicates a PR directly modifies the ACME Issuer code area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration area/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allowing skipping HTTP01 and DNS01 self-check on a per-solver basis

6 participants