Skip to content

cks: use kubeadm v1beta4 configuration API for external etcd clusters - #14183

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

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

Conversation

@kiranchavala

@kiranchavala kiranchavala commented Sep 16, 2026

Copy link
Copy Markdown
Member

Description

Fixes: #14181

Tested on CloudStack 4.22 / KVM with Kubernetes v1.37.0 (kubeadm version -o short on the control node).

Before — creating a cluster with external etcd nodes, kubeadm init fails with the error above, repeated for each of the three MAX_SETUP_CRUCIAL_CMD_ATTEMPTS retries and then indefinitely by systemd:

root@test-cks-etcd-control-1a0a97ce958:/opt/bin# ./deploy-kube-system status
error: your configuration file uses an old API spec: "kubeadm.k8s.io/v1beta3" (kind: "ClusterConfiguration"). Please use kubeadm v1.36 instead and run 'kubeadm config migrate --old-config old-config-file --new-config new-config-file', which will write the new, similar spec using a newer API version.
To see the stack trace of this error execute with --v=5 or higher
error: your configuration file uses an old API spec: "kubeadm.k8s.io/v1beta3" (kind: "ClusterConfiguration"). Please use kubeadm v1.36 instead and run 'kubeadm config migrate --old-config old-config-file --new-config new-config-file', which will write the new, similar spec using a newer API version.
To see the stack trace of this error execute with --v=5 or higher
error: your configuration file uses an old API spec: "kubeadm.k8s.io/v1beta3" (kind: "ClusterConfiguration"). Please use kubeadm v1.36 instead and run 'kubeadm config migrate --old-config old-config-file --new-config new-config-file', which will write the new, similar spec using a newer API version.
To see the stack trace of this error execute with --v=5 or higher
Error: kubeadm init failed!

After — with the template changed to v1beta4, kubeadm init --config completes and the control plane comes up:

kube-system   kube-apiserver-<control-node>            1/1   Running
kube-system   kube-controller-manager-<control-node>   1/1   Running
kube-system   kube-scheduler-<control-node>            1/1   Running
kube-system   kube-proxy-<...>                         1/1   Running

The control node's /etc/kubernetes/kubeadm-config.yaml was written with the
kubeadm.k8s.io/v1beta3 configuration API. kubeadm removed v1beta3 in Kubernetes
1.37, so "kubeadm init --config" now rejects the file outright:

  error: your configuration file uses an old API spec: "kubeadm.k8s.io/v1beta3"
  (kind: "ClusterConfiguration"). Please use kubeadm v1.36 instead and run
  'kubeadm config migrate --old-config old-config-file --new-config new-config-file',
  which will write the new, similar spec using a newer API version.
  Error: kubeadm init failed!

This only affects clusters created with external etcd nodes, as that is the only
path which passes the configuration file to kubeadm; the stacked etcd path and
both join paths use command line flags and are unaffected.

The failure is also hard to spot: kubeadm init runs from the deploy-kube-system
systemd unit, runcmd only does "systemctl start" on a Type=simple unit so
cloud-init reports success, and Restart=on-failure with StartLimitInterval=0
retries the whole cycle indefinitely.

Switch both documents to v1beta4. Only the apiVersion changes - neither document
sets the extraArgs fields whose shape changed between the two versions.

Tested on Kubernetes v1.37.0 (KVM): an external etcd cluster which previously
failed at kubeadm init now completes and the control plane comes up.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.93%. Comparing base (10037c8) to head (282efed).

Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #14183   +/-   ##
=========================================
  Coverage     17.93%   17.93%           
- Complexity    16142    16143    +1     
=========================================
  Files          5928     5928           
  Lines        535205   535205           
  Branches      65501    65501           
=========================================
+ Hits          95989    95991    +2     
+ Misses       428286   428285    -1     
+ Partials      10930    10929    -1     
Flag Coverage Δ
uitests 4.02% <ø> (ø)
unittests 19.00% <ø> (+<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.

@Pearl1594 Pearl1594 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

code lgtm

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.

2 participants