Skip to content

feat(chart): support probes for cert-manager and cainjector - #5670

Closed
maximee-leroyy wants to merge 1 commit into
cert-manager:masterfrom
maximee-leroyy:add-probes
Closed

maximee-leroyy wants to merge 1 commit into
cert-manager:masterfrom
maximee-leroyy:add-probes

Conversation

@maximee-leroyy

@maximee-leroyy maximee-leroyy commented Dec 30, 2022 •

Copy link
Copy Markdown

Pull Request Motivation

Currently it is not possible to configure readiness and liveness probes for all created Pods, when using cert-manager Helm chart. To conform to Kubernetes best-practices provide the ability to allow configuration probes in all created Pods.

Closes #5626

Kind

/kind feature

Release Note

Feature: The helm chart now supports `livenessProbe` and `readinessProbe` for the cert-manager and cainjector deployment so that the pod automatically restarts if it doesnt respond.

@jetstack-bot jetstack-bot added kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 30, 2022
@jetstack-bot

Copy link
Copy Markdown
Contributor

Hi @maxime1907. 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.

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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/deploy Indicates a PR modifies deployment configuration labels Dec 30, 2022
@maximee-leroyy

Copy link
Copy Markdown
Author

/assign @wallrj

@inteon

inteon commented Jan 4, 2023

Copy link
Copy Markdown
Member

/ok-to-test

@jetstack-bot jetstack-bot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 4, 2023
@wallrj

This comment was marked as duplicate.

@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.

@maxime1907 I'm not convinced that user configurable liveness, readiness and startup probes are appropriate for the controller or cainjector pods because:

  1. They both use a leader election process:
  • Liveness is already handled by the leader election process, which blocks the controllers from starting until this process has started leading and exits the process if it fails to renew the leadership lease.
  • Readiness is not necessary, because the leader election mechanism ensures that there is only ever one running pod for each of the deployments, so there will only ever be one Service endpoint.
  • Startup is not appropriate because both of these pods start up quickly but may wait indefinitely if they startup when there is already an elected leader.
  1. If these probes are necessary, the user should not have to decide how to configure them. How would they know what are appropriate endpoints for these health checks? The cert-manager maintainers are best placed to know if and how these checks should be performed.

  2. If there are advanced users who nevertheless want to set these probes and who understand the implications of setting them, they can use Helm post rendering directly or via a deployment tool like Flux.

Please challenge me on those points because I'm not 100% sure. Come to our daily stand up meeting if you want to chat about it in person..

@jetstack-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: maxime1907
To complete the pull request process, please ask for approval from wallrj after the PR has been reviewed.

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

@maximee-leroyy

Copy link
Copy Markdown
Author

@wallrj

  1. Yes they both use the leader election process but:
  1. I am okay with not being able to customize the httpGet part of the probes but we should at least be able to configure other parameters like failureThreshold, initialDelaySeconds, timeoutSeconds, and periodSeconds

  2. Thanks for pointing out helm advanced feature post rendering, didnt know about that!

I am not an expert in leader election so feel free to correct me if i said something wrong!

@irbekrm irbekrm added the triage/needs-information Indicates an issue needs more information in order to work on it. label Feb 14, 2023
@irbekrm

irbekrm commented Feb 14, 2023

Copy link
Copy Markdown
Contributor

Adding a 'more information needed' label- I think we should check with upstream what the best practices are for this and maybe document it in our contributor docs helm charts section https://cert-manager.io/docs/contributing/policy/#additional-configuration-options-for-the-helm-chart

@wallrj

wallrj commented Apr 27, 2023

Copy link
Copy Markdown
Member

@maxime1907 Sorry for not responding sooner. Thank you for answering my points and for making us aware of the LeaderElectionHealthz adaptor. We have just merged #5962 which adds an optional liveness probe and /livez endpoint to the cert-manager controller, using the LeaderElectionHealthzAdaptor.
We've added some limited Helm configuration options, as you suggested.

It's a bit more difficult to integrate the LeaderElectionHealthzAdaptor with the cainjector; that will require a change in controller-runtime, but we will try and get that done next.

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

Copy link
Copy Markdown
Contributor

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.

@maximee-leroyy

Copy link
Copy Markdown
Author

@wallrj Thanks for adding the optional liveness probe to the controller and okay for the cainjector.
I guess i can close this PR then?

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

Labels

area/deploy Indicates a PR modifies deployment configuration dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/needs-information Indicates an issue needs more information in order to work on it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm: Allow configuration of readiness, liveness and startup probes for all created Pods

5 participants