bhouse-nexthop opened a new pull request, #14825: URL: https://github.com/apache/cloudstack/pull/14825
### Description CKS upgrade now reaches each node over SSH on the public port of that node's port forwarding rule, not on 2222 + its position in the VM list. Once nodes have been added, removed or skipped as manual-upgrade, the position no longer lines up with the port. Fixes: #14824 | cluster | before | after | |---|---|---| | isolated, VPC tier, Netris | SSH IP : 2222 + position | SSH IP : public port (2222 and up) of the node's tcp PF rule to port 22; Active, then Add, then Staged rules | | shared/routed (direct access) | control: cluster SSH IP : 22, others: node IP : 22 | node IP : 22 | | external load balancer | LB IP : 2222 + position in the filtered list | LB IP : 2222 + place among the cluster's non-etcd nodes (the documented LB mapping) | | node has no such rule | SSH to a guessed port, fails after retries (or upgrades the wrong node) | upgrade fails before it starts (no state change, drain or SSH) with an error naming the node and the IP | Where the plugin works out a node's SSH port on 4.22: | caller | what it does | changed? | |---|---|---| | `KubernetesClusterUpgradeWorker.runInstallScriptOnVM` | per-node SSH, `sshPort + index` | yes, all nodes resolved up front via new `KubernetesClusterActionWorker#getClusterNodesSshIpPorts` | | `KubernetesClusterRemoveWorker.removeNodeVmFromCluster` | per-node SSH | no, it already reads the node's PF rule | | `KubernetesClusterAddWorker.validateAndSetupNode` | SSH to the port it just created | no, it uses its own new rule (port choice is #14798) | | `getKubernetesClusterServerIpSshPort` (scale, upgrade drain, remove, start, add) | control node at 2222 | no, the first control node gets 2222 at create and keeps it | | `getVmPortMap` / `provisionSshPortForwardingRules` | (re)creates rules at create/scale | no, it creates rules, it doesn't look ports up | Related, all independent and merge cleanly with this one: - #14798 (free SSH port for add-node), #14800 (remove-node rule matching), #14775 (add-node revert), #14819 (add-node result), #14806 / #14808 (scale offerings). - Not changed here: scale still re-creates the SSH PF rules by position. ### 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? - `KubernetesClusterActionWorkerTest` (6 new): picks the node's tcp rule to 22 from 2222 up, Active over Add over Staged, skips Deleting, ignores other VMs, udp, other private ports and ports below 2222; no rule (error names node and IP); unknown IP; direct access; external LB position skipping etcd. - `KubernetesClusterUpgradeWorkerTest` (2 new): nodes on 2222, 2223 and 2225 get the upgrade script on exactly those ports (never 2224); `upgradeCluster` with a node without a rule fails before any state change, ISO attach or SSH. - `mvn -pl plugins/integrations/kubernetes-service test`: all pass, also with #14798, #14800, #14775, #14819, #14806 and #14808 merged in. #### How did you try to break this feature and the system with this change? - Manual-upgrade node in the middle of the list, a removed node leaving a gap, a node with extra non-SSH PF rules. - Not run on a live cluster yet. -- 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]
