Skip to content

Use kubeadm config apiVersion v1beta4 for Kubernetes 1.31+ (#14897) - #14947

Open
ravening wants to merge 1 commit into
apache:mainfrom
ravening:vibe/fix-14897-kubeadm-v1beta4-96810d
Open

ravening wants to merge 1 commit into
apache:mainfrom
ravening:vibe/fix-14897-kubeadm-v1beta4-96810d

Conversation

@ravening

@ravening ravening commented Dec 2, 2026

Copy link
Copy Markdown
Member

Description

CKS wrote /etc/kubernetes/kubeadm-config.yaml with apiVersion: kubeadm.k8s.io/v1beta3 for every Kubernetes version. kubeadm 1.31 replaced v1beta3 with v1beta4 and kubeadm 1.37 rejects v1beta3, so kubeadm init failed for external-etcd clusters on 1.37+. The template now uses a {{ k8s.kubeadm.api.version }} placeholder: v1beta4 for Kubernetes >= 1.31, v1beta3 for older versions (which don't know v1beta4).

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)

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

Rendered the kubeadm-config block of k8s-control-node.yml with the placeholder substituted and validated it as YAML. Version selection uses the existing KubernetesVersionManagerImpl.compareSemanticVersions helper; compilation runs in PR CI (no JDK in the working environment).

Closes #14897

)

### Description

CKS wrote `/etc/kubernetes/kubeadm-config.yaml` with `apiVersion: kubeadm.k8s.io/v1beta3` for every Kubernetes version. kubeadm 1.31 replaced v1beta3 with v1beta4 and kubeadm 1.37 rejects v1beta3, so `kubeadm init` failed for external-etcd clusters on 1.37+. The template now uses a `{{ k8s.kubeadm.api.version }}` placeholder: `v1beta4` for Kubernetes >= 1.31, `v1beta3` for older versions (which don't know v1beta4).

### Types of changes

- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] 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)

### Bug Severity

- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial

### How Has This Been Tested?

Rendered the kubeadm-config block of `k8s-control-node.yml` with the placeholder substituted and validated it as YAML. Version selection uses the existing `KubernetesVersionManagerImpl.compareSemanticVersions` helper; compilation runs in PR CI (no JDK in the working environment).

Closes apache#14897

Co-authored-by: ravening <ravening@users.noreply.github.com>
@codecov

codecov Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.07%. Comparing base (8eaff97) to head (c318a30).

Files with missing lines Patch % Lines
...er/actionworkers/KubernetesClusterStartWorker.java 0.00% 13 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              main   #14947       +/-   ##
============================================
+ Coverage     3.86%   21.07%   +17.21%     
- Complexity       0    21284    +21284     
============================================
  Files          494     6058     +5564     
  Lines        42890   549904   +507014     
  Branches      8142    73540    +65398     
============================================
+ Hits          1657   115914   +114257     
- Misses       41001   420363   +379362     
- Partials       232    13627    +13395     
Flag Coverage Δ
uitests 3.86% <ø> (ø)
unittests 22.53% <0.00%> (?)

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.

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.

CKS: kubeadm config uses v1beta3, which kubeadm 1.37 rejects

3 participants