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

   ### Description
   
   A VM removed from a CKS cluster and added again never rejoins. 
`/home/cloud/success` stays on the VM, so the join scripts exit with `Already 
provisioned!` and the add times out.
   
   | change | why |
   |---|---|
   | add worker: the SSH step that clears the cloud-init semaphores also 
deletes the marker, stops a leftover `deploy-kube-system`, clears 
`/mnt/k8sdisk` and `/aux-dwnld`, disables kubelet and runs `kubeadm reset -f` 
if kubeadm is installed | lets `setup-kube-system` run cleanly again on a VM 
that was set up before |
   | that step runs after the user data update, right before the reboot | 
validation has no side effects any more |
   | `validateNodes`: reject a VM mapped to any live Kubernetes cluster, not 
only the target one; drop duplicate ids | the reset must not wipe a node 
another cluster still uses, or reset a VM twice |
   | `KubernetesClusterVmMapDao.listByVmId` | the check above needs every 
mapping row |
   
   Why on add and not on remove:
   
   - covers VMs already removed by older releases, which still carry the marker
   - covers removals that skipped the worker step (no SSH rule found)
   - add always has SSH to the VM
   
   Every step is best effort and logged, the same as the existing semaphore 
cleanup.
   
   Fixes: #14795
   
   ### 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?
   
   | test | result |
   |---|---|
   | `KubernetesClusterAddWorkerTest` (new): reset command, SSH success, 
failure and exception | pass |
   | `KubernetesClusterManagerImplTest`: `validateNodes` with no mapping, a 
live mapping, a stale mapping, stale plus live rows, duplicate ids | pass |
   | full `kubernetes-service` module tests | pass |
   | reset command checked with `bash -n` and `dash -n` | ok |
   
   Not yet run on a live cluster.
   
   #### How did you try to break this feature and the system with this change?
   
   - a VM still in another cluster: rejected before anything runs on it
   - a VM with no kubeadm installed (first add): the reset step skips kubeadm
   - a failing reset: logged, and the add continues as before
   


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