Skip to content

CKS: use kubeadm v1beta4 config for Kubernetes 1.31 and later - #14899

Open
bhouse-nexthop wants to merge 1 commit into
apache:4.22from
bhouse-nexthop:cks-kubeadm-v1beta4
Open

bhouse-nexthop wants to merge 1 commit into
apache:4.22from
bhouse-nexthop:cks-kubeadm-v1beta4

Conversation

@bhouse-nexthop

Copy link
Copy Markdown
Collaborator

Description

Fixes #14897

For clusters with external etcd nodes, CKS writes a kubeadm config file and runs kubeadm init --config with it. The file always used kubeadm.k8s.io/v1beta3. kubeadm 1.37 refuses v1beta3, and kubeadm before 1.31 doesn't know v1beta4.

Kubernetes version Before After
< 1.31 v1beta3 v1beta3
1.31 – 1.36 v1beta3 (deprecated) v1beta4
>= 1.37 v1beta3, kubeadm init fails v1beta4

Every field CKS sets (apiServer.certSANs, controlPlaneEndpoint, etcd.external.endpoints, bootstrapTokens, nodeRegistration.criSocket, localAPIEndpoint, certificateKey) is the same in both versions. None of the fields whose shape changed in v1beta4, such as extraArgs, are used.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

  • Unit test for the version cutoff (1.30.14, 1.31.0, 1.35.2).
  • Filled in the kubeadm config from the template with sample values and ran kubeadm config validate --config with the release binaries:
kubeadm v1beta3 file v1beta4 file
1.30.14 ok rejected (unknown version)
1.34.2 ok ok
1.37.3 rejected (old API spec) ok
  • Not tested yet: a full external etcd CKS deploy.

How did you try to break this feature and the system with this change?

  • The other templates (k8s-node.yml, k8s-control-node-add.yml) and upgrade-kubernetes.sh pass kubeadm flags and don't read a config file, so they are not affected.
  • Existing clusters don't read this file again after the first kubeadm init, so upgrades across 1.31 are not affected.

The kubeadm config CKS writes for clusters with external etcd always
used kubeadm.k8s.io/v1beta3. v1beta4 replaced it in Kubernetes 1.31,
and kubeadm 1.37 refuses v1beta3. Pick v1beta4 when the cluster's
Kubernetes version is 1.31 or later and keep v1beta3 for older
versions, which do not know v1beta4. The fields CKS sets are the same
in both.

Signed-off-by: Brad House <bhouse@nexthop.ai>
@codecov

codecov Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.34%. Comparing base (a8735b2) to head (5b333cb).

Files with missing lines Patch % Lines
...er/actionworkers/KubernetesClusterStartWorker.java 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #14899   +/-   ##
=========================================
  Coverage     18.34%   18.34%           
- Complexity    16671    16679    +8     
=========================================
  Files          5939     5939           
  Lines        537817   537824    +7     
  Branches      65938    65938           
=========================================
+ Hits          98640    98670   +30     
+ Misses       427954   427929   -25     
- Partials      11223    11225    +2     
Flag Coverage Δ
uitests 4.08% <ø> (ø)
unittests 19.43% <71.42%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bhouse-nexthop

Copy link
Copy Markdown
Collaborator Author

Tested on a KVM lab with 4.22 plus this change: an external etcd cluster on k8s 1.32.3 came up Running, and the control node's kubeadm config is kubeadm.k8s.io/v1beta4. The same build without the change writes v1beta3.

Not run: a version below 1.31 on a live cluster (unit test covers the cutoff).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant