Skip to content

CKS upgrade fails on the first control node: upgrade-kubernetes.sh applies manifests while the API server restarts #14911

In review

Description

@bhouse-nexthop

Problem

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

  1. Set cloud.kubernetes.cluster.upgrade.retries to 0.
  2. Create a CKS cluster (1 control node is enough).
  3. Add a newer Kubernetes version and call upgradeKubernetesCluster.
  4. 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.

Activity

  1. added this to the 4.22.3 milestone on Dec 2, 2026
  2. github-actions commented on Dec 3, 2026

    @github-actions

    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.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

    🔗 Similar issues

    💡 Notes and suggestions

    Generated by Daily Issue Triage · copilot · haiku55 · ~11 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions