bhouse-nexthop opened a new pull request, #14754:
URL: https://github.com/apache/cloudstack/pull/14754

   ### Description
   
   Fixes #14753
   
   When a CKS node VM goes down, Kubernetes keeps its volumes attached and 
stateful pods stay stuck until the node returns. This adds the non-graceful 
node shutdown taint `node.kubernetes.io/out-of-service=nodeshutdown:NoExecute` 
to the node while CloudStack knows its VM is down, and removes it when the VM 
runs again.
   
   | what | how |
   |---|---|
   | setting | `cloud.kubernetes.cluster.node.out.of.service.taint.enabled`, 
global, dynamic, default `false` |
   | where | the existing CKS state scanner, for Running and Alert clusters on 
Kubernetes 1.26+ |
   | taint when the VM is | Stopped, Destroyed, Expunging |
   | never taint when the VM is | Running, Starting, Stopping, Migrating, 
Unknown, Shutdown, Error, backup/restore states |
   | left alone | clusters being scaled, upgraded, stopped or having nodes 
removed (VM and cluster state re-read just before each kubectl call) |
   | how kubectl runs | over SSH on any running control node, same addressing 
as the upgrade worker; no running control node means skip quietly |
   | untaint | when the VM is Running again; works even if the setting was 
turned off since |
   | bookkeeping | tainted VM ids in a cluster detail 
(`outOfServiceTaintedVms`), written before tainting so a lost result still gets 
cleaned up |
   
   Why only those states: a host that is merely disconnected leaves its VMs 
Running in the DB, and the VM may well still be running. Stopped is only set 
once CloudStack has stopped the VM or HA has decided the host is down. 
Force-detaching a volume that is still in use risks corruption, so anything 
less certain is skipped.
   
   Why default off: the taint makes Kubernetes attach the node's volumes 
elsewhere, which is only safe where "Stopped" really means powered off (e.g. 
host HA with fencing). Operators should opt in.
   
   ### Types of changes
   
   - [x] New feature (non-breaking change which adds functionality)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   - [x] Minor
   
   ### How Has This Been Tested?
   
   | test | result |
   |---|---|
   | `KubernetesClusterNodeTaintWorkerTest` (14 new) | pass |
   | all `KubernetesCluster*Test` in the plugin | pass |
   | live cluster | not 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]

Reply via email to