-
Notifications
You must be signed in to change notification settings - Fork 21
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 opt-in scale from zero API requirements #30
Conversation
This change adds a very simple controller that will reconcile on KubemarkMachineTemplates. It will log the template names as it reconciles them. Also updates the generated files.
This change adds a status field to KubemarkMachineTemplate, and within the status, a capacity field to signal the generated machine's sizing. It is being added to satisfy the optional API requirement for autoscaling from zero as defined by the enhancement[0] This change also adds some unit tests for util functions, and refactors common artifacts into a separate file. [0] https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: elmiko 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 |
i'm relatively happy with this as an initial implementation, but there is one issue i have not figured out yet. when the user has not specified extended resources, the machine controller will default to using 1 cpu / 4G ram, but i'm not sure if we should be defaulting that for the machine template as it is not clear that the value will be valid on kubernetes clusters with versions <1.22. my gut says the new controller should default in the same manner as the machine controller, but i could use an extra opinion or two. |
/lgtm |
This change set brings in several modifications that allow the kubemark provider to satisfy the requirements for scaling from zero as defined in the enhancement.
It adds a new
status
field to the KubemarkMachineTemplate CRD. Within thestatus
field struct is a single member,capacity
, to hold the sizing of the machines created by the template. Thecapacity
field is only populated when the user has specified extended resources in their machine template spec.To do the work of reading and updating KubemarkMachineTemplates, a new controller has been added to watch them and add the status block when necessary.