Skip to content

Conversation

usamaahmadkhan
Copy link
Contributor

Issue

closes #4102

Description

Allow override default values of webhook certificates by templating fields duration and renewBefore

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

Copy link

linux-foundation-easycla bot commented Mar 24, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Welcome @usamaahmadkhan!

It looks like this is your first PR to kubernetes-sigs/aws-load-balancer-controller 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-load-balancer-controller has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 24, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @usamaahmadkhan. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 24, 2025
@usamaahmadkhan usamaahmadkhan force-pushed the enhancement/certmanager-duration branch from ff3f83f to f38c6c6 Compare March 24, 2025 10:37
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 24, 2025
@usamaahmadkhan
Copy link
Contributor Author

/assign @wweiwei-li

@wweiwei-li
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 26, 2025
@usamaahmadkhan
Copy link
Contributor Author

@wweiwei-li seems like govulncheck is failing. Let me know how to proceed. I would like to merge this ASAP.

@@ -257,6 +257,8 @@ The default values set by the application itself can be confirmed [here](https:/
| `podDisruptionBudget` | Limit the disruption for controller pods. Require at least 2 controller replicas and 3 worker nodes | `{}` |
| `updateStrategy` | Defines the update strategy for the deployment | `{}` |
| `enableCertManager` | If enabled, cert-manager issues the webhook certificates instead of the helm template, requires cert-manager and it's CRDs to be installed | `false` |
| `certManager.duration` | Set the expiry duration for the webhook certificates. Used only when `enableCertManager: true` | `""` |
| `certManager.renewBefore` | Set the renewal time period duration for the webhook certificates. Used only when `enableCertManager: true`. If this value is greater than `certManager.duration`, it will be automatically renewed 2/3rds of the way through the certificate’s duration. | `""` |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this automatically renewal handled from cert-manager side?

@@ -257,6 +257,8 @@ The default values set by the application itself can be confirmed [here](https:/
| `podDisruptionBudget` | Limit the disruption for controller pods. Require at least 2 controller replicas and 3 worker nodes | `{}` |
| `updateStrategy` | Defines the update strategy for the deployment | `{}` |
| `enableCertManager` | If enabled, cert-manager issues the webhook certificates instead of the helm template, requires cert-manager and it's CRDs to be installed | `false` |
| `certManager.duration` | Set the expiry duration for the webhook certificates. Used only when `enableCertManager: true` | `""` |
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't look correct to me, if enableCertManager is set to true, the webhook is issued by the cert-manager instead of supplied by helm chart. so the value you try to add in helm chart won't take effect.

@@ -237,6 +237,14 @@ spec:
kind: Issuer
name: {{ template "aws-load-balancer-controller.namePrefix" . }}-selfsigned-issuer
secretName: {{ template "aws-load-balancer-controller.webhookCertSecret" . }}
{{- with .Values.certManager -}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This manifest will only be rendered when

{{- if not $.Values.enableCertManager }} 

it conflicts with your statement in README. Please clarify

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oliviassss current behaviour is that If enableCertManager is true, duration and renewBefore fields are not specified in the Certificate resource and the implicit behaviour of the certmanager controller is that it will issue for 90d and renew after 60d.

This change allows to override this behaviour by explicitly mentioning duration and renewBefore fields optionally if enableCertManager is true

@usamaahmadkhan
Copy link
Contributor Author

usamaahmadkhan commented Mar 27, 2025

@oliviassss I have updated the description to be more precise. Let me know if it needs further improvement

@oliviassss
Copy link
Collaborator

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2025
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 27, 2025
@oliviassss oliviassss added tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 27, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: oliviassss, surenraju-careem, usamaahmadkhan, wweiwei-li

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [oliviassss,wweiwei-li]

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 28, 2025
@wweiwei-li
Copy link
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2025
@k8s-ci-robot k8s-ci-robot merged commit de50bdd into kubernetes-sigs:main Mar 29, 2025
9 checks passed
zac-nixon pushed a commit to zac-nixon/aws-load-balancer-controller that referenced this pull request Apr 3, 2025
… certs (kubernetes-sigs#4105)

* Allow override Certificate fields for duration

* Add docs for new fields

* Update documentation text to be more precise

* fix typo
zac-nixon pushed a commit to zac-nixon/aws-load-balancer-controller that referenced this pull request Apr 29, 2025
… certs (kubernetes-sigs#4105)

* Allow override Certificate fields for duration

* Add docs for new fields

* Update documentation text to be more precise

* fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Enhancement] Allow overriding of default webhook certificate values
5 participants