bhouse-nexthop opened a new pull request, #14781: URL: https://github.com/apache/cloudstack/pull/14781
### Description This PR makes CKS check each node's user data against `vm.userdata.max.length` before that node's VM is deployed, and fail with an error that says what's wrong. New error: > User data for control node of Kubernetes cluster foo is 34120 bytes after base64 encoding, over vm.userdata.max.length (32768). Raise vm.userdata.max.length. | path | node type | check fires before | |---|---|---| | create: first control node (after the CNI config is appended) | control | control VM deploy | | create: additional control nodes | control | that VM's deploy | | create: etcd nodes | etcd | that VM's deploy | | create / scale: worker nodes | worker | first new worker VM deploy | | add existing VMs as nodes | worker | ISO attach, state change, any firewall/PF rule | Other changes: - Uses the same limit and length measure as `UserDataManagerImpl` at deploy time, so the numbers match. - `logTransitStateAndThrow` appends the cause's message when the cause is an `InvalidParameterValueException`, so the API error shows the reason instead of only `Provisioning the control VM failed ...`. - A size failure on an etcd node moves the cluster to Error, instead of leaving it in `Starting`. - Add-node renders the worker config once instead of once per node. Limits: - On create, VMs deployed before the failing node (e.g. etcd nodes, if the control node is the one over the limit) stay until the cluster is deleted, the same as any other create failure. Fixes: #14780 ### 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 - [ ] Major - [x] Minor - [ ] Trivial ### How Has This Been Tested? | test | result | |---|---| | `KubernetesClusterActionWorkerTest`: under, at and over the limit; cause message appended, not repeated, dropped for other types | pass | | all `KubernetesCluster*Test` in `cloud-plugin-integrations-kubernetes-service` (62 tests) | pass | #### How did you try to break this feature and the system with this change? - Checked the deploy-time validation (`UserVmManagerImpl.createVirtualMachine` → `UserDataManagerImpl`) to confirm CKS passes the final user data unchanged, so the pre-check can't reject anything deploy would accept. - Checked that the worker config doesn't vary per node, so rendering it once on add-node is equivalent. -- 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]
