bhouse-nexthop opened a new pull request, #14829: URL: https://github.com/apache/cloudstack/pull/14829
### Description CKS scale no longer revokes and re-creates every node's SSH port forwarding and firewall rules by list position. Nodes that already have an SSH rule keep it (same port, same rule id); only nodes without one get a rule, on a free port. Scale down removes only the removed nodes' own rules. Fixes: #14828 | path | before | after | |---|---|---| | scale up, existing nodes | all SSH PF rules revoked and re-created at 2222 + position; new ids; added nodes moved or doubled | untouched | | scale up, new node | 2222 + position, no conflict check | its positional port if free, else the lowest free port from 2222 (skips every PF / LB / other non-firewall rule on the IP) | | scale up, firewall (isolated) | old range rule revoked, new 2222..2222+n-1 created (conflicts with an added node's rule -> scale fails with rules already gone) | single-port 0.0.0.0/0 TCP rule only if no open TCP rule already covers the port; an existing node whose port no TCP firewall rule covers gets one back | | scale up, failure | partial | the new node's firewall and PF rules are revoked, scale fails with the port in the message | | scale down | everything re-created; middle nodes renumbered | each removed node's PF rule and its exact-port open TCP firewall rule revoked right after the VM is expunged; cluster range rule shrunk to the highest port still in use (old range put back if that fails) | | destroy, kept network (isolated) | one SSH firewall rule revoked; added/scaled nodes' rules leak | also revokes each node's exact-port open TCP firewall rule (ports read before the VMs are expunged) | | shared / routed / external LB | no network rules | unchanged | Depends on / related (all merge cleanly together, module tests pass with all merged): - #14825: upgrade reads each node's port from its PF rule. Merge it first: with this PR alone, upgrade after a `nodeids` scale-down would still use 2222 + position. - #14798: add-node picks a free port and skips open firewall rules. Merge it first too: the 4.22 add-node port formula can hit a kept port. - #14800 (remove-node rule matching), #14806 / #14808 (scale offerings), #14819 (add-node result), #14823 (cluster offering sync). ### 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? - `KubernetesClusterScaleWorkerSshRulesTest` (new, 19 tests): existing rules kept; new worker on its positional port; positional port held by an added node -> next free; hole left by a removed worker reused; port already open -> no firewall rule; restricted rule -> own rule added, not healed; VPC -> no firewall rules; direct access -> nothing; no free port -> error; two new nodes never share a port; heal of a node port with no firewall rule; rollback of firewall + PF on failure; removal revokes only the node's own open rule and PF; restricted exact-port rule kept; shrink closes top ports, keeps rule if top still used, restores old range on failure. - `mvn -pl plugins/integrations/kubernetes-service test`: all pass, also with #14825, #14798, #14800, #14806, #14808, #14819 and #14823 merged in. - Not run on a live cluster yet. #### How did you try to break this feature and the system with this change? - Added node holding the next positional port, nodeids scale-down in the middle, firewall rule deleted by hand, restricted CIDR rule over the range, VPC tier and Netris NAT IP, PF create failing after the firewall rule was made. -- 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]
