-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Migrating flags off main.go to a separate package #7890
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
Migrating flags off main.go to a separate package #7890
Conversation
|
Welcome @YahiaBadr! |
|
Hi @YahiaBadr. 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 Once the patch is verified, the new status will be reflected by the 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. |
x13n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup, thanks! Just a few minor comments.
| } | ||
|
|
||
| if isFlagPassed("max-autoprovisioned-node-group-count") { | ||
| klog.Warning("The max-autoprovisioned-node-group-count flag is deprecated and will be removed in k8s version 1.31.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are approaching 1.33 release, perhaps these flags could be cleaned up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } | ||
|
|
||
| if isFlagPassed("node-autoprovisioning-enabled") { | ||
| klog.Warning("The node-autoprovisioning-enabled flag is deprecated and will be removed in k8s version 1.31.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are approaching 1.33 release, perhaps these flags could be cleaned up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, what about the UpdateNapEnabled metric, should we remove it as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I don't think it makes sense to keep a metric based on a deprecated flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| cloudBuilder "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/builder" | ||
| "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/gce/localssdsize" | ||
| "k8s.io/autoscaler/cluster-autoscaler/config" | ||
| "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/actuation" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to depend on actuation module? Looks like the only function used is some flag parsing util, perhaps it could be refactored a bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, yeah i think we can include it in flags.go aside to the other parsing functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
e8f526a to
ea799d3
Compare
x13n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just two minor comments.
| DebuggingSnapshotEnabled bool | ||
| // EnableProfiling is debug/pprof endpoint enabled. | ||
| EnableProfiling bool | ||
| // Address is the address to expose prometheus metrics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not just prometheus - also healthchecks & profiles. Can you update the comment to something more generic that will reflect current usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| // It only refers to check capacity ProvisioningRequests, but if not empty, best-effort atomic ProvisioningRequests processing is disabled in this instance. | ||
| // Not recommended: Until CA 1.35, ProvisioningRequests with this name as prefix in their class will be also processed. | ||
| CheckCapacityProcessorInstance string | ||
| // MaxInactivityTime is the maximum time from last recorded autoscaler activity before automatic restart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: MaxInactivityTime / MaxFailingTime don't control restarts directly, only healthchecks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ea799d3 to
241ad7a
Compare
|
Thanks! /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: x13n, YahiaBadr 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Currently the flag declaration is coupled with main.go, which should only care about execution.
With this change, we're decoupling flags with main.go, to provide extensibility for cloud-providers to integrate config to execution better.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: