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

chore: port all non deprecated, non apiserver/controller-manager referenced features to versioned #126791

Merged
merged 7 commits into from
Sep 4, 2024

Conversation

Jefftree
Copy link
Member

@Jefftree Jefftree commented Aug 19, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Continuation of #126878 and #125031. Migrate all features that are not deprecated and not redefined in other places like apiserver and controller manager (they have their own feature gates).

As of 8/29/2024, there are 150 unversioned features and 2 versioned features. After this PR, there will be 45 unversioned features and 107 versioned features. The cardinality is the same so we can guarantee that all features that existed before still exist after the PR.

Obviously this doesn't 100% guarantee that version information is correct, I've taken the version information in the comments from https://github.com/kubernetes/kubernetes/blob/master/pkg/features/kube_features.go#L28 and constructed it in versioned_feature_gates.go, preserving the current comments like // remove after 1.33 as much as possible. These were manually cross referenced by both me and aaron-prindle.

Before

kubernetes ❯ ./hack/verify-featuregates.sh 
found 150 features in FeatureSpecMap var defaultKubernetesFeatureGates in file: /usr/local/google/home/jying/gospace/src/k8s.io/kubernetes/pkg/features/kube_features.go
...
found 2 features in FeatureSpecMap var defaultVersionedKubernetesFeatureGates in file: /usr/local/google/home/jying/gospace/src/k8s.io/kubernetes/pkg/features/versioned_kube_features.go

After:

kubernetes ❯ ./hack/verify-featuregates.sh
found 45 features in FeatureSpecMap var defaultKubernetesFeatureGates in file: /usr/local/google/home/jying/gospace/src/k8s.io/kubernete
s/pkg/features/kube_features.go
...
found 107 features in FeatureSpecMap var defaultVersionedKubernetesFeatureGates in file: /usr/local/google/home/jying/gospace/src/k8s.io/kubernetes/pkg/features/versioned_kube_features.go

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Follow ups:

  • CSIMigrationPortworx needs a beta switch in the website

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 19, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Aug 19, 2024
@Jefftree
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 21, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 27, 2024
@Jefftree
Copy link
Member Author

/retest

@Jefftree Jefftree changed the title [WIP] Port feature gates to versioned chore: port all non deprecated, non apiserver/controller-manager referenced features to versioned Aug 27, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 27, 2024
@aaron-prindle
Copy link
Contributor

aaron-prindle commented Aug 28, 2024

LegacyServiceAccountTokenCleanUp doesn't seem to be ported over when it possibly should be IIUC. It has this comment:

// GA in 1.30; remove in 1.32

but I believe you ported over other features with this comment and it doesn't fit into the groups to omit IIUC. Just wanted to raise this, not sure if it should be ported over atm

RuntimeClassInImageCriAPI: {
{Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha},
},
ElasticIndexedJob: {
Copy link
Contributor

@aaron-prindle aaron-prindle Aug 28, 2024

Choose a reason for hiding this comment

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

This has the following comment in kube_feautures.go

	// owner: @danielvegamyhre
	// kep: https://kep.k8s.io/2413
	// beta: v1.27
	//
	// Allows mutating spec.completions for Indexed job when done in tandem with
	// spec.parallelism. Specifically, spec.completions is mutable iff spec.completions
	// equals to spec.parallelism before and after the update.
	ElasticIndexedJob featuregate.Feature = "ElasticIndexedJob"

This says it is in beta but perhaps the comment is incorrect, just wanted to raise this in case

Copy link
Member Author

Choose a reason for hiding this comment

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

be410c0#diff-71e3b98f9a6bbf5b8421e26a7ba0c079f397cd8d49abacdad943c66a4f44f03d

Graduation is here, thanks for catching this will update the comment

{Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha},
{Version: version.MustParse("1.30"), Default: true, PreRelease: featuregate.Beta},
},
ServiceAccountTokenNodeBinding: {
Copy link
Contributor

Choose a reason for hiding this comment

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

The code here says beta: v1.30 but the comment from kube_features.go says beta: 1.31. I think this may need to be changed.

	// owner: @munnerz
	// kep: http://kep.k8s.io/4193
	// alpha: v1.29
	// beta: v1.31
	//
	// Controls whether the apiserver supports binding service account tokens to Node objects.
	ServiceAccountTokenNodeBinding featuregate.Feature = "ServiceAccountTokenNodeBinding"

Copy link
Member Author

Choose a reason for hiding this comment

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

ServiceAccountTokenNodeBinding looks to be correct at 1.31 https://github.com/kubernetes/kubernetes/blob/master/pkg/features/kube_features.go#L719. You're looking at ServiceAccountTokenJTI which is beta at 1.30 and that seems to match the comments https://github.com/kubernetes/kubernetes/blob/master/pkg/features/kube_features.go#L710

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah sorry, +1 it is correct as is

@Jefftree
Copy link
Member Author

LegacyServiceAccountTokenCleanUp doesn't seem to be ported over when it possibly should be IIUC. It has this comment:

// GA in 1.30; remove in 1.32

but I believe you ported over other features with this comment and it doesn't fit into the groups to omit IIUC. Just wanted to raise this, not sure if it should be ported over atm

#126839 removes the feature gate. IMO features that transitioned to GA in or before 1.31 should be safe to remove because they cannot be turned off both in 1.31 and future versions.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 3, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 4, 2024
@@ -677,6 +677,7 @@ const (
// owner: @danielvegamyhre
// kep: https://kep.k8s.io/2413
// beta: v1.27
// stable: v1.31
Copy link
Member

Choose a reason for hiding this comment

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

Generally, we use GA: v1.31.

A quick search shows that we have five stable: v1.x in this file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed all to GA

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 4, 2024
@aaron-prindle
Copy link
Contributor

aaron-prindle commented Sep 4, 2024

I believe this PR has addressed most of the deltas discovered in the below gist in a go through of kube_features.go vs kubernetes/website vs actual k8s releases from discussion w/ @Jefftree offline. My findings from my going through of all of the features in kube_features.go and comparing to the values in kubernets/website (and direct k8s releases) are here:
https://gist.github.com/aaron-prindle/8a56b33f70f7275a142d618efacea779

Going to create an issue + PR against kubernetes/website to fix the deltas I discovered there.

I believe the only outstanding item from this for this PR is changing StatefulSetAutoDeletePVC from alpha: 1.22 -> alpha: 1.23

(feature was added and then removed in 1.22 - fb5b966)

@aaron-prindle
Copy link
Contributor

/lgtm

@k8s-ci-robot
Copy link
Contributor

@aaron-prindle: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

@jpbetz
Copy link
Contributor

jpbetz commented Sep 4, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 4, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e922dc3d82bd568734258808484640835f2a8a37

@Jefftree
Copy link
Member Author

Jefftree commented Sep 4, 2024

/sig architecture
/hold cancel

@k8s-ci-robot k8s-ci-robot added sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 4, 2024
@Jefftree
Copy link
Member Author

Jefftree commented Sep 4, 2024

/retest

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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants