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

Add pprof to all VPA components #7153

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

adrianmoisey
Copy link
Member

@adrianmoisey adrianmoisey commented Aug 10, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Add proof to all 3 VPA components.

Which issue(s) this PR fixes:

Fixes #6946

Special notes for your reviewer:

The change was inspired by the cluster-autoscaler implementation of pprof. I figured it made sense to move a lot of the logic out of the metrics package, as that code handled metrics, health check and pprof.

EDIT: I don't know if I handled the dependencies and vendoring correctly, so I left them in their own commit in case that needs to be changed.

Does this PR introduce a user-facing change?

Add --profiling parameter to all 3 VPA components to enable pprof

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


This change was inspured by how the cluster-autoscaler impliments pprof.

Fixes kubernetes#6946
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 10, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @adrianmoisey. Thanks for your PR.

I'm waiting for a kubernetes 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 the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 10, 2024
@adrianmoisey
Copy link
Member Author

@kwiesmueller any chance you can look at this?

@kwiesmueller
Copy link
Member

/assign @voelzmo @raywainman

@@ -13,6 +13,7 @@ require (
golang.org/x/time v0.4.0
k8s.io/api v0.28.3
k8s.io/apimachinery v0.28.3
k8s.io/apiserver v0.0.0-00010101000000-000000000000
Copy link
Contributor

Choose a reason for hiding this comment

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

It's weird that it is using a pseudo-version number... Do you know why it is importing this?

What happens if you try to pull in a specific version? Maybe we can use the same as cluster autoscaler?

k8s.io/apiserver v0.31.0-beta.0

(I'm not an expert in this so sorry if this is totally off - this just looks weird to me)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think 679d6bd fixes it
I used 0.28.3, since that's what the VPA currently uses

metrics_admission.Register()

go func() {
pathRecorderMux := mux.NewPathRecorderMux("vertical-pod-autoscaler")
Copy link
Contributor

Choose a reason for hiding this comment

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

reading the documentation and it looks like this name is used for logging, should we make this unique across each binary?

eg. here we would make it vertical-pod-autoscaler-admission-controller

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in e4fc614

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: adrianmoisey
Once this PR has been reviewed and has the lgtm label, please ask for approval from voelzmo. 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

@raywainman
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 5, 2024
@raywainman
Copy link
Contributor

/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 Sep 5, 2024
@adrianmoisey
Copy link
Member Author

/assign voelzmo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pprof for vpa-admission-controller
5 participants