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

VPA: Add automated flag generator for all components #7599

Merged
merged 8 commits into from
Dec 16, 2024

Conversation

omerap12
Copy link
Member

@omerap12 omerap12 commented Dec 12, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds an automated script to generate VPA flags.Integrated into the current Makefile such as:

make document-flags

Which issue(s) this PR fixes:

Fixes #7589

Special notes for your reviewer:

Since this is a Go environment, I preferred using Go instead of Bash, Python, or other scripting languages.

Does this PR introduce a user-facing change?

NONE

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

NONE

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. labels Dec 12, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 12, 2024
@omerap12 omerap12 force-pushed the automated-flags branch 2 times, most recently from 58cb294 to abaf8ea Compare December 13, 2024 08:57
@omerap12 omerap12 changed the title WIP: add generate flags scripts VPA: Add recommender-flags to Makefile Dec 13, 2024
@omerap12 omerap12 marked this pull request as ready for review December 13, 2024 09:05
@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 13, 2024
@omerap12 omerap12 changed the title VPA: Add recommender-flags to Makefile VPA: Add automated flag generator for all components Dec 13, 2024
@adrianmoisey
Copy link
Member

This is super cool, thank you!

I have some thoughts:

  1. Would it be useful to make a script that combines all the flags into a single doc file, something like ./docs/flags.md. That way it will be easy to integrate into docs
  2. Some of the output needs work, such as --eviction-rate-limit for the updater, its default is rendered as &{2367 - 0x140001eb6a0}
  3. Some newlines are making their way into the tables, breaking the rendered markdown

Comment on lines 92 to 93
.PHONY: admission-flags
admission-flags:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.PHONY: admission-flags
admission-flags:
.PHONY: document-flags
document-flags:

Would it make sense to make the name of the Makefile job the same across all components?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah it does! lol I feel dumb

@omerap12
Copy link
Member Author

This is super cool, thank you!

I have some thoughts:

  1. Would it be useful to make a script that combines all the flags into a single doc file, something like ./docs/flags.md. That way it will be easy to integrate into docs
  2. Some of the output needs work, such as --eviction-rate-limit for the updater, its default is rendered as &{2367 - 0x140001eb6a0}
  3. Some newlines are making their way into the tables, breaking the rendered markdown
  1. Sure, I can handle that. It’ll just be a simple wrapper, probably like five lines in bash.
  2. Thanks for pointing that out. I’ll check why it’s happening.
  3. Ah, I see—it’s due to the multiline content. I’ll make adjustments.

@adrianmoisey
Copy link
Member

  1. Sure, I can handle that. It’ll just be a simple wrapper, probably like five lines in bash.

Yeah, I was thinking of a bash script that would do something like:

  1. Run the make command for each file
  2. Concatenate the outputs for all 3 into a single file (may be with a header that is a table of contents)
  3. Move that file in ./docs/flags.md

@omerap12
Copy link
Member Author

  1. Sure, I can handle that. It’ll just be a simple wrapper, probably like five lines in bash.

Yeah, I was thinking of a bash script that would do something like:

  1. Run the make command for each file
  2. Concatenate the outputs for all 3 into a single file (may be with a header that is a table of contents)
  3. Move that file in ./docs/flags.md

exactly what I'm doing now :)

@omerap12
Copy link
Member Author

@adrianmoisey, you can now run the script with:
./create-flags-doc-vpa.sh (it works when run from within the hack directory).
Should I update the script to support running it from outside the hack directory as well?

Signed-off-by: Omer Aplatony <[email protected]>
@adrianmoisey
Copy link
Member

Should I update the script to support running it from outside the hack directory as well?

Yup, I think so.
For #7608 I originally made my own script to do that, but ended up copying the logic in https://github.com/kubernetes/autoscaler/blob/1ba600754bd60d720b4634ece0e5b2e8efcefe78/vertical-pod-autoscaler/hack/generate-crd-yaml.sh

Signed-off-by: Omer Aplatony <[email protected]>
Co-authored-by: Adrian Moisey <[email protected]>
omerap12 and others added 2 commits December 16, 2024 11:13
Co-authored-by: Adrian Moisey <[email protected]>
Signed-off-by: Omer Aplatony <[email protected]>
@adrianmoisey
Copy link
Member

/lgtm

This is awesome, thanks!

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

Thanks a lot for this!

/lgtm

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: omerap12, raywainman

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:

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 Dec 16, 2024
@k8s-ci-robot k8s-ci-robot merged commit 6bbc649 into kubernetes:master Dec 16, 2024
7 checks passed
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. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update flags for vpa components automatically
4 participants