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

Bump DefaultKubeBinaryVersion to 1.33 #128279

Merged
merged 5 commits into from
Dec 20, 2024
Merged

Conversation

Jefftree
Copy link
Member

@Jefftree Jefftree commented Oct 23, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Bump DefaultKubeBinaryVersion to 1.33

  • Fixed the etcd tests to account for previous emulated versions
  • Removed a emulated version test that tests for 1.30. Unfortunately we don't have a GA API in the 1.31-1.32 range to test the storage version, it might be worthwhile to (similar to the metrics test) create a fake API that we inject into tests for this purpose.
  • Changed the version validation to support n-3 with clamp at 1.31 min for emulatedVersion and 1.30 min for minCompatibilityVersion

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

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


/triage accepted

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 23, 2024
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/release Categorizes an issue or PR as relevant to SIG Release. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 23, 2024
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/test sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/etcd Categorizes an issue or PR as relevant to SIG Etcd. area/apiserver and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 5, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 10, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 20, 2024
@Jefftree Jefftree force-pushed the compat-133 branch 3 times, most recently from fa38c5f to bb10eaa Compare December 20, 2024 18:04
Copy link
Member Author

@Jefftree Jefftree left a comment

Choose a reason for hiding this comment

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

Updated PTAL

test/integration/apiserver/apiserver_test.go Show resolved Hide resolved
test/integration/metrics/metrics_test.go Show resolved Hide resolved
test/integration/metrics/metrics_test.go Outdated Show resolved Hide resolved
test/integration/metrics/metrics_test.go Outdated Show resolved Hide resolved
@@ -118,7 +118,7 @@ func TestVersionFlagOptions(t *testing.T) {
func TestVersionFlagOptionsWithMapping(t *testing.T) {
r := testRegistry(t)
utilruntime.Must(r.SetEmulationVersionMapping(testComponent, DefaultKubeComponent,
func(from *version.Version) *version.Version { return from.OffsetMinor(3) }))
func(from *version.Version) *version.Version { return version.MajorMinor(1, from.Minor()+23) }))
Copy link
Member Author

Choose a reason for hiding this comment

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

This was updated because the original test was not written to check the actual values of the mapping, just a placeholder for a mapping exist. So it is actually mapping test 2.8 to kube 2.11, which is not aligned with the kube binary at all.

This change fixes the test to the correct version mapping.

cc @siyuanfoundation @liggitt

Copy link
Member

Choose a reason for hiding this comment

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

is adding 23 to the minor correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mapping is from test component 2.7 -> kube 1.30 and 2.8 -> kube 1.31 which is where the +23 was derived from specifically for this test.

@Jefftree
Copy link
Member Author

Jefftree commented Dec 20, 2024

k8s.io/client-go/tools: cache expand_less | 44s
{Failed  === RUN   TestAddWhileActive
polling
==================
WARNING: DATA RACE

This seems a bit worrisome but I was also able to reproduce this on master. Created #129352

/test pull-kubernetes-unit

@liggitt
Copy link
Member

liggitt commented Dec 20, 2024

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: 6d8358d261407306af388a95732946346359e891

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jefftree, liggitt

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 20, 2024
@k8s-ci-robot k8s-ci-robot merged commit 9d82148 into kubernetes:master Dec 20, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Dec 20, 2024
// Only test for beta and GA APIs with emulated version.
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, feature.DefaultFeatureGate, version.MustParse(v))
featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, "AllBeta", true)
registerEffectiveEmulationVersion(t)
Copy link
Member

@aojea aojea Jan 9, 2025

Choose a reason for hiding this comment

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

This presents a problem , and it took me several days to find it but I still can't figure out how to solve it.

If you checkout my PR #128971 and apply the following patch

diff --git a/pkg/controlplane/apiserver/apis.go b/pkg/controlplane/apiserver/apis.go
index 7ed3a58489b..47dc2cf2467 100644
--- a/pkg/controlplane/apiserver/apis.go
+++ b/pkg/controlplane/apiserver/apis.go
@@ -89,6 +89,7 @@ func (s *Server) InstallAPIs(restStorageProviders ...RESTStorageProvider) error
        nonLegacy := []*genericapiserver.APIGroupInfo{}
 
        // used later in the loop to filter the served resource by those that have expired.
+       klog.Infof("DEBUG ---------- effective emulation version %s", s.GenericAPIServer.EffectiveVersion.EmulationVersion().String())
        resourceExpirationEvaluator, err := genericapiserver.NewResourceExpirationEvaluator(s.GenericAPIServer.EffectiveVersion.EmulationVersion())
        if err != nil {
                return err

and runs the test

go test -timeout 600s -run ^TestEtcdStoragePath$ k8s.io/kubernetes/test/integration/etcd -v -count 1 | grep -E 'DEBUG|TestEtcdStoragePath'

you can see that the 1.33 fails because it it keeps using the emulated version 1.32 with 1.33 , this causes the APIExpiration thingy to disable the v1 version of the apiserver for servicecidrs and ipaddresses, and the cluster can not start

=== RUN   TestEtcdStoragePath/1.33
I0109 00:21:01.588321 2218629 serving.go:380] Generated self-signed cert (/tmp/TestEtcdStoragePath1.3382862738/apiserver.crt, /tmp/TestEtcdStoragePath1.3382862738/apiserver.key)
I0109 00:21:01.590392 2218629 dynamic_serving_content.go:116] "Loaded a new cert/key pair" name="serving-cert::/tmp/TestEtcdStoragePath1.3382862738/apiserver.crt::/tmp/TestEtcdStoragePath1.3382862738/apiserver.key"
I0109 00:21:01.989808 2218629 apf_controller.go:292] NewTestableController "Controller" with serverConcurrencyLimit=600, name=Controller, asFieldManager="api-priority-and-fairness-config-consumer-v1"
I0109 00:21:02.018277 2218629 apis.go:92] DEBUG ---------- effective emulation version 1.32

however, if you run the test individually it works fine

PASS
{"level":"warn","ts":"2025-01-09T00:24:46.595770Z","caller":"embed/serve.go:160","msg":"stopping insecure grpc server due to error","error":"accept tcp 127.0.0.1:42889: use of closed network connection"}
{"level":"warn","ts":"2025-01-09T00:24:46.595848Z","caller":"embed/serve.go:162","msg":"stopped insecure grpc server due to error","error":"accept tcp 127.0.0.1:42889: use of closed network connection"}
I0109 00:24:51.596565 2223139 etcd.go:158] etcd didn't exit in 5 seconds, killing it
I0109 00:24:51.596601 2223139 etcd.go:164] etcd exit status: signal: terminated
ok      k8s.io/kubernetes/test/integration/etcd 19.938s

cc: @liggitt @Jefftree @siyuanfoundation

Copy link
Member Author

Choose a reason for hiding this comment

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

Confirming this is an issue. The variable is actually reset properly but we need to call https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-apiserver/app/testing/testserver.go#L208-L209 to register the proper effective version with the component. Will send a fix

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry about the frustration. #129416 should be able to fix the problem.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry about the frustration. #129416 should be able to fix the problem.

not sorry about nothing, these things happen, we need to break some eggs to do the omelette :)

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. area/apiserver area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/etcd Categorizes an issue or PR as relevant to SIG Etcd. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants