Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make readiness probe optional #392

Conversation

ThatsMrTalbot
Copy link
Contributor

No description provided.

Signed-off-by: Adam Talbot <adam.talbot@venafi.com>
@cert-manager-prow cert-manager-prow bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Aug 28, 2024
@cert-manager-prow
Copy link
Contributor

[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 thatsmrtalbot. 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

@cert-manager-prow cert-manager-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 28, 2024
Copy link
Member

@SgtCoDFish SgtCoDFish left a comment

Choose a reason for hiding this comment

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

I've had a think about this and dug in a bit!

tls Check

The tls check doesn't seem hugely helpful to preserve as a readiness check in the pure runtime config scenario.

Once it passes it'll never fail by the looks of it. Only context cancellation (on shutdown) will set the tlsConfig to nil which is the only way that the check can fail.

server Check

Likewise, the other check, server only checks the "ready" bool, which is set to true after initial bootstrapping and then only unset on shutdown.

Overall

The checks aren't ideal. The TLS check would be better if it returned true if the cert was still valid and the server check would be better if it only returned true when an issuer was configured.

That makes it ok to disable them like this, I think. We're not losing much.

That said, I think the optics of fully disabling a readiness check which is already defined (which we'd have to do for pure runtime configuration) aren't great though. People will (reasonably) question it.

Alternative

An alternative is:

  1. When using pure runtime config, we short-circuit the readiness checks we already have to return a healthy response until the first time an issuer is configured. This is basically just for Helm.
  2. When an issuer is configured, we no longer short circuit and the readiness checks revert to what they are now.
  3. Down the line (after all this is merged) we improve those checks to be more helpful. Specifically, we should return not ready if the configmap defining the issuer is then deleted (but that's a separate piece of work)

In that scenario, I think we'd want the readiness checks enabled and this new helm value wouldn't be used. That's a little more work for us now, but is it better for users?

What do you think? I feel like that's a lot of words, sorry 🙃

@ThatsMrTalbot
Copy link
Contributor Author

@SgtCoDFish

I originally was planning to alter the checks if the issuer was not set, however we default the issuer in the Helm config. This means a user would have to explicitly unset three Helm values to get into this mode.

An alternative is we could add an option app.certmanager.issuer.enabled that defaults to true, then not set the flags if it is false.

From there we could make the changes to the checks you describe.

Thoughts?

@SgtCoDFish
Copy link
Member

I originally was planning to alter the checks if the issuer was not set, however we default the issuer in the Helm config. This means a user would have to explicitly unset three Helm values to get into this mode.

I think this is a bit of a tangent to the issue at hand, no? Like, it's not a great UX and I rather that the issuer didn't have a default value but we're kinda forced to accept it now for backwards compat reasons.

Although I guess it's a better UX to have app.certmanager.issuer.enabled and just have to set it to false than having to do the blanking. I think I'd support that!

@ThatsMrTalbot
Copy link
Contributor Author

Superseded by #395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants