bhouse-nexthop opened a new pull request, #14923:
URL: https://github.com/apache/cloudstack/pull/14923
### Description
Upgrading a CKS cluster left it on the CloudStack Kubernetes provider and
CSI driver it was created with, whatever the binaries ISO of the new version
holds. `upgrade-kubernetes.sh` copies the provider manifest of the ISO to the
nodes and the worker calls `deployProvider()`, but `deploy-provider` exits as
soon as a `cloud-controller-manager` pod exists. The CSI driver manifests of
the ISO were not copied at all. The CNI and dashboard manifests are already
applied by the upgrade script, so only these two were left behind.
This PR:
- Copies the CSI driver manifests of the ISO to `/opt/csi` in
`upgrade-kubernetes.sh`, as the control node setup does at create, with the
same fix for the document separator of the v3.0.0 manifest.
- Once every node is upgraded and the ISO detached, and before the version
of the cluster is recorded, runs `kubectl apply` on the control node for:
- the provider, except on a shared network (as `deployProvider()`), then
waits for the `cloud-controller-manager` rollout;
- the CSI driver, when the cluster has it, then waits for the controller
and node rollouts. The snapshot CRDs are shared with other snapshot users, so
they are only created when missing.
- Tries each `cloud.kubernetes.cluster.upgrade.retries` + 1 times within the
upgrade timeout. If it still fails, the upgrade fails and the version is not
recorded, so upgrading to the same version again applies them again.
The commands run from the management server rather than from the node
scripts, as clusters created by older releases keep old copies of those scripts.
They are applied after all the nodes, so every node already has the images
of the new ISO when the new pods are scheduled. Applying an unchanged manifest
changes nothing, so a cluster whose new ISO has the same add-ons sees no
restart. Fields that CKS does not set in these manifests are kept, as `kubectl
apply` is client side.
No schema change, no new API parameter or setting.
Fixes #14922
### 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)
### Feature/Enhancement Scale or Bug Severity
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial
### How Has This Been Tested?
Unit tests in `KubernetesClusterUpgradeWorkerTest`: both add-ons applied;
the provider skipped on a shared network and the CSI driver when the cluster
does not have it; retries then the error; an exception without a message
reported as a failure; no retry once the upgrade timeout has passed; success
after a failed try.
A lab report on a KVM zone follows in a comment.
#### How did you try to break this feature and the system with this change?
- A cluster created without the CSI driver: nothing applied for it.
- An ISO without CSI driver manifests: the CSI step is skipped with a
message.
- Snapshot CRDs already present: left untouched.
--
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]