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

KEP-4330: Change API availability to forward compatibility and add NonEmulatableFeatures #5038

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

siyuanfoundation
Copy link
Contributor

  • One-line PR description: some feature updates to make it easier to handle API graduation in compatibility version.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 14, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: siyuanfoundation
Once this PR has been reviewed and has the lgtm label, please assign dims for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 14, 2025
@siyuanfoundation
Copy link
Contributor Author

siyuanfoundation commented Jan 14, 2025

@siyuanfoundation siyuanfoundation force-pushed the compat-versions-api branch 2 times, most recently from 6abb021 to fbbc5f7 Compare January 14, 2025 05:37
Instead, we are proposing to keep forward compatibility of all AIPs in compatibility version mode:
All APIs group-versions declarations would be modified
to track which Kubernetes version the API group-versions are removed at. APIs introduced between the emulation version and
the binary version are still available if the stability level is no less than the APIs introduced before or at the emulation version and enabled at the emulation version.
Copy link
Member

Choose a reason for hiding this comment

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

Most of this is referring to API enablement/disablement on a group-version level. However, API lifecycles are generally individual on the group-version-resource level. I think it would make more sense to discuss the individual beta->GA resources rather than the entire group version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.


Alpha APIs may not be enabled in conjunction with emulation version.

The forward compatibility of APIs should not affect data compatibility because storage version is still controlled by the `MinCompatibilityVersion` regardless of whether the data are created through future versions of the API endpoints. Webhooks should also work fine if the matching policy is `Equivalent`.
Copy link
Member

@Jefftree Jefftree Jan 14, 2025

Choose a reason for hiding this comment

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

I think we should add a section on how MinCompatibilityVersion will change storage version since the policy has always been n-1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in #5006

to track which Kubernetes version the API group-versions are introduced (or
removed) at.
removed) at. But in practice, that would make code changes of API graduation intractable.
Copy link
Member

Choose a reason for hiding this comment

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

intractable only for withholding API introductions. API removals don't need special handling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the whole section. Please review again see if it is more clear.

@@ -610,21 +623,25 @@ The storage version of each group-resource is the newest

### API availability

Similar to feature flags, all APIs group-versions declarations will be modified
Ideally, similar to feature flags, all APIs group-versions declarations should be modified
Copy link
Member

Choose a reason for hiding this comment

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

Is this referring to the prerelease lifecycle files or a different mechanism? prerelease lifecycle operates on the types instead of the group version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is referring to the the prerelease lifecycle.

Comment on lines 628 to 629
removed) at: if an API is introduced after (or removed before) the emulation version, it should not be available at the emulation version. But in practice, that would make code changes of API graduation that wants to use newer APIs intractable.
For example, if a controller is switching from Beta to GA API at the binary version, a full emulation would mean the whole controller code needs to be
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding is that we're doing this specifically for controllers. Are there other use cases or should we simplify the wording here and just state up front that we're doing this to support controllers specifically?

the emulation version is set to. I.e. `--runtime-config=api/<version>` needs
to be able to turn on APIs exactly like it did for each Kubernetes version that
emulation version can be set to.
If an API has GAed and has not been removed at the emulated version, it would be enabled by default at the emulation version. If a newer stable version of the GA API has been introduced between the emulation version and the binary version, the new GA API would also be enabled at the emulation version along with the old GA API.
Copy link
Contributor

Choose a reason for hiding this comment

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

A comparison (maybe in a table), or how emulation works for normal APIs vs how it works for un-emulatable (non-emulatable?) features might make this information easier to digest.


GA APIs should match the exact set of APIs enabled in GA for the Kubernetes version
the emulation version is set to.
Instead, we are proposing to keep forward compatibility of all APIs in compatibility version mode:
Copy link
Contributor

Choose a reason for hiding this comment

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

We're proposing that non-emulatable feature controllers to update to use the newest available API, ignoring emulation API enablement, right? Maybe say this more directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, mainly for controllers for now. May expand to kublet if we want to add compat version in node. Updated the section.

So this exception should only be used if the feature
1. is Beta and disabled by default for at least one version in the range of `1.{binaryMinorVersion-3}..1.{binaryMinorVersion-1}`.
1. is going through a lot of changes when it is off by default, and the feature implementation history is very hard to preserve.
1. has stabilized after it is enabled by default.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are un-emulatable features intended as a stop-gap during beta or is this intended to be a permanent property of the emulation versions feature?

If this is Beta only, let's add a line item in the graduation criteria about resolving this before GA.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intention is to have it as a permanent property of the emulation versions feature. The API forward compatibility is a workaround for non-emulatable controller features. But there could be really difficult cases where non of the options work. We should have something to handle that instead of letting the feature be emulated with unpredictable results.

@siyuanfoundation siyuanfoundation force-pushed the compat-versions-api branch 2 times, most recently from 48e2f87 to f8bce11 Compare January 14, 2025 22:37
@siyuanfoundation siyuanfoundation changed the title KEP-4330: Change API availability to forward compatibility and add UnEmulatableFeatures KEP-4330: Change API availability to forward compatibility and add NonEmulatableFeatures Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants