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

✨ (go/v4): feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) #4400

Merged

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Dec 1, 2024

feat/fix: enhance cert-manager integration for metrics endpoints

This commit is a follow-up to PR #4243, which introduced support for using cert-manager certificates for securing the metrics endpoint and ServiceMonitor. Related to #3871 and #4003

Key enhancements:

  • Added support for configuring certificate integration via a Kustomize patch.
  • Introduced configurable flags for greater flexibility in customization.
  • Use Certwatcher to allow certificate rotation

This configuration provides an option for users to be production-ready.

These improvements enhance usability and adaptability while maintaining compatibility with the initial implementation. As the feature has not yet been released, this update ensures a polished and user-friendly integration for upcoming releases.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 1, 2024
@camilamacedo86 camilamacedo86 changed the title Follow up of: #4243 - Ensure that production configuration to protect… feat: Add Kustomize patch and flags for metrics certificates configuration Dec 1, 2024
@camilamacedo86 camilamacedo86 changed the title feat: Add Kustomize patch and flags for metrics certificates configuration ✨ feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) Dec 1, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch from 167e3cf to 5e02482 Compare December 1, 2024 17:14
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 1, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch from 5e02482 to a53d785 Compare December 1, 2024 17:20
@camilamacedo86 camilamacedo86 changed the title ✨ feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) WIP: ✨ feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) Dec 1, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 1, 2024
@camilamacedo86 camilamacedo86 added release-blocker and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Dec 1, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch 3 times, most recently from 2f012e8 to fe0b824 Compare December 1, 2024 17:52
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 1, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch 2 times, most recently from 6114658 to 7bcaf26 Compare December 1, 2024 18:51
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 1, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch from 7bcaf26 to 323eb3e Compare December 1, 2024 19:06
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 1, 2024
@camilamacedo86 camilamacedo86 changed the title WIP: ✨ feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) ✨ feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) Dec 1, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 1, 2024
@camilamacedo86 camilamacedo86 added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed priority/backlog Higher priority than priority/awaiting-more-evidence. labels Dec 1, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 14, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch 4 times, most recently from b6ffce9 to 732a5ee Compare December 14, 2024 20:58
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 15, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch from 732a5ee to 169ac65 Compare December 16, 2024 12:30
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 16, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch from 169ac65 to f828442 Compare December 16, 2024 12:48
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 16, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch from f828442 to 0fde893 Compare December 16, 2024 12:48
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 16, 2024
@camilamacedo86 camilamacedo86 changed the title ✨ (go/v4): feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) (WIP - We need to fix after rebase ) ✨ (go/v4): feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) Dec 16, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2024
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch 2 times, most recently from 442dea3 to 13d6efa Compare December 16, 2024 19:42
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
mountPath: /tmp/k8s-webhook-server/serving-certs
name: webhook-certs
readOnly: true
- op: add
path: /spec/template/spec/containers/0/ports
value: []
Copy link
Member Author

@camilamacedo86 camilamacedo86 Dec 16, 2024

Choose a reason for hiding this comment

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

we introduced it here: #4429
But when we try to have metrics or webhooks both
It will overwrite the values :-(
So, we cannot have that.

…low-up to PR kubernetes-sigs#4243)

This commit is a follow-up to PR kubernetes-sigs#4243, which introduced support for using cert-manager certificates for securing the metrics endpoint and ServiceMonitor. Related to kubernetes-sigs#3871 and kubernetes-sigs#4003

Key enhancements:
- Added support for configuring certificate integration via a Kustomize patch.
- Introduced configurable flags for greater flexibility in customization.
- Use Certwatcher to allow certificate rotation

These improvements enhance usability and adaptability while maintaining compatibility with the initial implementation. As the feature has not yet been released, this update ensures a polished and user-friendly integration for upcoming releases.
@camilamacedo86 camilamacedo86 force-pushed the protect-metrics-production branch from 13d6efa to 7ca04b8 Compare December 16, 2024 20:27
@camilamacedo86 camilamacedo86 changed the title (WIP - We need to fix after rebase ) ✨ (go/v4): feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) ✨ (go/v4): feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #4243) Dec 16, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2024
@@ -50,33 +50,33 @@ func (f *ManagerWebhookPatch) SetTemplateDefaults() error {
return nil
}

//nolint:lll
// nolint:lll
// nolint:lll

Choose a reason for hiding this comment

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

should it be doubled ?

Copy link
Member Author

Choose a reason for hiding this comment

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

No should be only one :-)
good catcher

Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

/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 Dec 18, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, grzesuav, varshaprasad96

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 [camilamacedo86,varshaprasad96]

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 merged commit e54dabf into kubernetes-sigs:master Dec 18, 2024
26 of 27 checks passed
@camilamacedo86 camilamacedo86 deleted the protect-metrics-production branch December 18, 2024 11:45
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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-blocker size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants