bhouse-nexthop opened a new issue, #14911: URL: https://github.com/apache/cloudstack/issues/14911
### 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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
