-
Notifications
You must be signed in to change notification settings - Fork 4.3k
VPA: Add UpdateModeInPlaceOrRecreate to types #7933
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 UpdateModeInPlaceOrRecreate to types #7933
Conversation
6528d05 to
7040e26
Compare
This adds the UpdateModeInPlaceOrRecreate mode to the types so we can use it. Signed-off-by: Max Cao <[email protected]>
7040e26 to
7b462b1
Compare
|
/lgtm |
|
If we modify the CRD, shouldn’t we also update its version? |
I'm not sure but it's probably a good idea since this is a big enhancement? I'd defer to an approver for this one. |
I'm not 100% sure, we need to get confirmation here, but since this is a backwards compatible change to the API, we don't need to bump it. |
|
|
There seems to be some guidelines here: |
|
Nice find on the guidelines @adrianmoisey. My understanding is that this change would fall under these new enum value guidelines. From my interpretation, we are following the required steps here by guarding usage via a feature flag. My understanding here is that we do not need a new API version to introduce this change. Would love at least one more person to confirm though :) |
|
I'll link that part you mentioned for convenience: https://github.com/kubernetes/community/blob/19094aa6e60eb4a481650c4cbdb94badd9919b5b/contributors/devel/sig-architecture/api_changes.md#new-enum-value-in-existing-field Going through the steps to ensure compatibility:
Yes, we've done that in the other PR.
type Frobber struct {
// restartPolicy may be set to "Always" or "Never" (or "OnTuesday" if the alpha "FrobberRestartPolicyOnTuesday" feature is enabled).
// Additional policies may be defined in the future.
// Unrecognized policies should be treated as "Never".
RestartPolicy string `json:"policy"
}Never mind, it seems already seems to fine to me I think, unless people has other thoughts.
We don't use the REST storage strategy in VPA (to my knowledge), but we validate VPA during creation using the VPA webhook. I've already taken care of this in the big PR #7673, so that will come in later. (Prevents creation of the new field, but doesn't error if already persisted or updated: https://github.com/kubernetes/autoscaler/pull/7673/files#diff-ad66c76a76541b7991631925641b989fc402901440d8e0dcbc3591009eef52b9R126. I just need to add an extra Question is if and how we can test different VPA versions, though. Maybe a followup PR is needed?
Same as above, done in the big PR.
We'll take care of that later, and it's already documented in the AEP thanks to Adrian. So I think we are good here not to update the CRD (coming from the author, so another confirmation would be awesome as Ray said), but please let me know if I missed anything. |
kwiesmueller
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.
Sounds good to me.
I wonder if we should make this clear on the field somehow (not sure if kubebuilder supports annotating a single enum option.
But at least in the doc we should say that it might not be supported yet or is feature guarded.
The guidelines are for kube-api, but we can translate them.
We should probably test that an older version of VPA doesn't panic/fail if it sees the new enum value. If it did we should fix that before we check-in this change (and even then it's a bit tricky).
Otherwise in the actual implementation as you discussed above we should comply with the validation guide. So a resource that has the field set, despite the feature being disabled, should be allowed to keep it iirc. while only new uses should be blocked if the feature is off.
That was my one worry as well, I quickly scanned the code and I believe we would simply treat this the same as |
|
/lgtm /approval |
|
/hold In case anyone else wants to take a look |
|
@maxcao13 maybe we let this one soak for another day or so and then remove the hold? |
|
Sure, I'm good with that. Thanks! |
|
/unhold - this has soaked for long enough |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maxcao13, raywainman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/unhold |
This just addes the UpdateModeInPlaceOrRecreate mode to the types so we can use it.
What type of PR is this?
/kind api-change
What this PR does / why we need it:
We need the new API to allow users to specify the new
InPlaceOrRecreatemode as part of AEP-4016.Which issue(s) this PR fixes:
This PR is part of the larger feature PR in #7673
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: