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 opt-in scale from zero API requirements #30

Merged
merged 2 commits into from
Feb 11, 2022

Conversation

elmiko
Copy link
Contributor

@elmiko elmiko commented Feb 11, 2022

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 the status field struct is a single member, capacity, to hold the sizing of the machines created by the template. The capacity 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.

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
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 11, 2022
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added 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 Feb 11, 2022
@elmiko
Copy link
Contributor Author

elmiko commented Feb 11, 2022

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.

@agradouski
Copy link
Contributor

/lgtm

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. 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.

3 participants