You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CKS upgrade fails on the first control node: upgrade-kubernetes.sh applies manifests while the API server restarts #14911
A CKS upgrade fails on the first control node on its first attempt. upgrade-kubernetes.sh applies the CNI manifest (network.yaml) and the dashboard manifest right after it restarts containerd and kubelet. The upgraded API server is still coming back up at that point, so kubectl apply fails, first with:
error when retrieving current configuration of: ... "/mnt/k8sdisk//network.yaml": Patch "https://<control node>:6443/apis/apiextensions.k8s.io/v1/customresourcedefinitions/ipamconfigs.crd.projectcalico.org?...": unexpected EOF
and then, while it does not yet authorize requests, with:
customresourcedefinitions.apiextensions.k8s.io "ipamblocks.crd.projectcalico.org" is forbidden: User "kubernetes-admin" cannot get resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
The script exits on the error. The management server runs the whole script again, up to cloud.kubernetes.cluster.upgrade.retries times (default 3). The second run works because the API server is up by then. So with the default setting the failure only shows as "retries left" lines in the management server log, and each upgrade spends a full extra script run on the control node. With cloud.kubernetes.cluster.upgrade.retries=0 every upgrade stops at the control node and the cluster goes to Alert.
Steps to reproduce
Set cloud.kubernetes.cluster.upgrade.retries to 0.
Create a CKS cluster (1 control node is enough).
Add a newer Kubernetes version and call upgradeKubernetesCluster.
The upgrade fails on the control node. The management server log shows the kubectl apply errors above from upgrade-kubernetes.sh, and the cluster is in Alert.
With the default 3 retries the upgrade succeeds, and the log shows the same errors on the control node's first attempt.
Expected
The script waits for the API server to accept the manifests, and the control node upgrades on its first attempt.
Versions
Seen on a main build: KVM, Ceph RBD primary storage, Calico from the binaries ISO, Kubernetes 1.33.1 to 1.34.7, 1 control and 2 worker nodes. The control node's first attempt failed this way in 4 of 4 upgrades. The same script lines are on 4.20, 4.22 and main.
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
On a CKS upgrade, upgrade-kubernetes.sh applies the CNI and dashboard manifests right after containerd and kubelet restart, while the API server is still starting. The first kubectl apply fails with unexpected EOF and then with forbidden errors. With the default three retries the upgrade succeeds on a later run, but with cloud.kubernetes.cluster.upgrade.retries=0 the upgrade stops at the control node and the cluster goes to Alert. Open PR #14912 is linked.
📊 Assessment
Dimension
Value
Reasoning
Type
type:bug
Script runs before the API server accepts manifests, with reproduction steps
Component
component:cks
Upgrade script in the CKS plugin
Severity
Severity:Major
With retries at 0, every upgrade stops at the control node
Labels
type:bug, component:cks, Severity:Major
Based on the issue text and the reporter's logs
Coding agent
Suitable
The expected fix is clear: wait for the API server before applying manifests. PR #14912 is open
Activity
github-actions commentedon Dec 3, 2026
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
Review the workflow run logs for details.
🎯 Triage report
On a CKS upgrade,
upgrade-kubernetes.shapplies the CNI and dashboard manifests right after containerd and kubelet restart, while the API server is still starting. The firstkubectl applyfails withunexpected EOFand then with forbidden errors. With the default three retries the upgrade succeeds on a later run, but withcloud.kubernetes.cluster.upgrade.retries=0the upgrade stops at the control node and the cluster goes to Alert. Open PR #14912 is linked.📊 Assessment
🔗 Similar issues
💡 Notes and suggestions
cloud.kubernetes.cluster.upgrade.retriesto 0, then upgrade a one-control-node cluster to a newer Kubernetes version.Add this agentic workflow to your repo
To install this agentic workflow, run