bhouse-nexthop opened a new issue, #14824:
URL: https://github.com/apache/cloudstack/issues/14824

   ### problem
   
   CKS upgrade works out each node's public SSH port from the node's position 
in the cluster VM list, not from the node's port forwarding rule. Once nodes 
were added with `addNodesToKubernetesCluster`, removed, or skipped as 
manual-upgrade, the position no longer matches the port, and the upgrade SSHes 
to the wrong node or to a port with no rule.
   
   In `KubernetesClusterUpgradeWorker.runInstallScriptOnVM`:
   
   ```java
   int nodeSshPort = sshPort == 22 ? sshPort : sshPort + index;
   ```
   
   `index` is the node's place in the VM list after manual-upgrade nodes are 
filtered out.
   
   Example, 1 control + 2 workers (2222-2224) on an isolated network:
   
   | step | rules | upgrade position → port |
   |---|---|---|
   | add A (manual upgrade), add B | A 2225, B 2226 | B is at index 3 → 2225: 
the upgrade script runs on A, B is never upgraded |
   | add A, add B, remove A | B 2226 | B is at index 3 → 2225: no rule, upgrade 
fails after retries |
   
   ### versions
   
   4.22 and main (same code). Isolated networks and VPC tiers (incl. Netris). 
Shared networks SSH to the node IP on port 22 and are not affected.
   
   ### The steps to reproduce the bug
   
   1. Create a CKS cluster (1 control, 2 workers) on an isolated network.
   2. `addNodesToKubernetesCluster` with VM A, then with VM B.
   3. `removeNodesFromKubernetesCluster` with VM A.
   4. `upgradeKubernetesCluster`: the step for B connects to port 2225 and 
fails.
   
   ### What to do about it?
   
   Take each node's SSH port from its port forwarding rule on the cluster's SSH 
IP (tcp, private port 22, matched by VM id). Fail with an error naming the node 
if it has none.
   


-- 
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]

Reply via email to