You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CKS add-node leaves the node's firewall rule behind when node validation fails #14774
When addNodesToKubernetesCluster is given a VM that fails node validation (validate-cks-node), the cleanup fails and leaves that node's SSH-port firewall rule behind:
Unable to find <id> having purpose [Firewall, Ipv6Firewall]
The next add-node then fails on the same port until someone deletes the rule by hand.
Cause, in KubernetesClusterAddWorker.revertNetworkRules:
step
what happens
firewall rule lookup
firewallRulesDao.findByNetworkIdAndPorts(network, port, port) has no purpose filter
match
the node's port-forwarding rule has the same network and port, so it can be returned instead
revoke
revokeIngressFirewallRule(<PF rule id>) throws, so the firewall rule stays
rest of revert
the PF loop never runs, so the PF rule stays too
versions
4.22 and main (the code is the same on both). Isolated network CKS cluster, add-node with an external VM.
The steps to reproduce the bug
Create a CKS cluster on an isolated network.
Call addNodesToKubernetesCluster with a VM that fails validate-cks-node (e.g. missing dependencies).
The add fails, and the management server logs the error above.
listFirewallRules on the cluster IP still shows the node's SSH port rule.
Run add-node again: it fails on that port.
What to do about it?
Revert only the rules the failed add created: match them by public IP and port (firewall: tcp, purpose Firewall; PF: destination port 22), skip rules that existed before, revoke PF first, then firewall, each on its own.
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.
When addNodesToKubernetesCluster fails node validation, the revert step cannot remove the node's SSH-port firewall rule. findByNetworkIdAndPorts has no purpose filter, so it can match the port-forwarding rule instead, and revoking that throws. The firewall rule stays, and the rest of the revert (including the port-forwarding rule) does not run. The next add-node then fails on the same port.
📊 Assessment
Dimension
Value
Reasoning
Type
type:bug
Revert leaves rules behind and blocks later adds
Component
component:cks
KubernetesClusterAddWorker.revertNetworkRules
Severity
Severity:Minor
Stale rule on one port; cleared by hand, and the reporter's workaround is a manual delete
Labels
type:bug, component:cks, Severity:Minor
Coding agent
Suitable
The reporter specifies the fix: match rules by public IP and port and revoke port-forwarding first
Activity
github-actions commentedon Nov 26, 2026
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
When
addNodesToKubernetesClusterfails node validation, the revert step cannot remove the node's SSH-port firewall rule.findByNetworkIdAndPortshas no purpose filter, so it can match the port-forwarding rule instead, and revoking that throws. The firewall rule stays, and the rest of the revert (including the port-forwarding rule) does not run. The next add-node then fails on the same port.📊 Assessment
KubernetesClusterAddWorker.revertNetworkRules🔗 Similar issues
validate-cks-nodedoes not checkip_forward; the validation failure that triggers this path💡 Notes and suggestions
listFirewallRuleson the cluster IP.Add this agentic workflow to your repo
To install this agentic workflow, run