Skip to content

CKS upgrade reaches nodes on the wrong SSH port after nodes are added or removed #14824

Backlog

Description

@bhouse-nexthop

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:

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.

Activity

  1. github-actions commented on Dec 1, 2026

    @github-actions

    Warning

    threat detection engine error
    The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

    What happened

    The threat detection engine failed to produce results.

    Review the workflow run logs for details.

    🎯 Triage report

    CKS upgrade computes each node's SSH port from its position in the VM list (sshPort + index), not from the node's port-forwarding rule. After nodes are added, removed or skipped for manual upgrade, the position no longer matches the rule, so the upgrade can run on the wrong node or on a port with no rule. The reporter gives a worked example and proposes reading each node's port from its rule on the cluster SSH IP.

    📊 Assessment

    Dimension Value Reasoning
    Type type:bug Wrong node or missing rule is used during upgrade, with reproduction steps
    Component component:cks KubernetesClusterUpgradeWorker.runInstallScriptOnVM; isolated and VPC networks
    Severity Severity:Major A node can be skipped or the upgrade can fail after retries
    Labels type:bug, component:cks, Severity:Major Based on the issue text
    Coding agent Suitable Fix is specified: read the port from the node's rule, and error if none exists

    🔗 Similar issues

    💡 Notes and suggestions
    • Reproduction: 1 control and 2 workers on an isolated network, add A and B, remove A, then upgrade.
    • Shared networks use port 22 on the node IP and are not affected, per the reporter.

    Generated by Daily Issue Triage · copilot · haiku55 · ~9 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions